@mim/histui 0.2.0 → 0.2.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/README.md +2 -2
- package/package.json +1 -1
- package/src/default-config.js +1 -1
- package/src/styles.css +1 -1
- package/src/timeline-view.js +5 -4
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ createHistuiTimeline({
|
|
|
157
157
|
measurement: {
|
|
158
158
|
enabled: true,
|
|
159
159
|
transient: true,
|
|
160
|
-
fadeOutMs:
|
|
160
|
+
fadeOutMs: 1200
|
|
161
161
|
},
|
|
162
162
|
explode: {
|
|
163
163
|
maxVisible: 42,
|
|
@@ -169,7 +169,7 @@ createHistuiTimeline({
|
|
|
169
169
|
});
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
`timeline.measurement.enabled` draws a dimension-style line across the currently visible timeline span and labels it with the visible year count. Set `timeline.measurement.transient` to `true` to show it only after the viewport changes; it fades out after `fadeOutMs` milliseconds, defaulting to `
|
|
172
|
+
`timeline.measurement.enabled` draws a dimension-style line across the currently visible timeline span and labels it with the visible year count. Set `timeline.measurement.transient` to `true` to show it only after the viewport changes; it fades out after `fadeOutMs` milliseconds, defaulting to `1200`.
|
|
173
173
|
|
|
174
174
|
## Check
|
|
175
175
|
|
package/package.json
CHANGED
package/src/default-config.js
CHANGED
package/src/styles.css
CHANGED
package/src/timeline-view.js
CHANGED
|
@@ -1575,13 +1575,13 @@ export class TimelineView {
|
|
|
1575
1575
|
|
|
1576
1576
|
getMeasurementConfig() {
|
|
1577
1577
|
const measurement = this.config.timeline?.measurement || {};
|
|
1578
|
-
const fadeOutMs = Number(measurement.fadeOutMs ?? measurement.hideAfterMs ??
|
|
1578
|
+
const fadeOutMs = Number(measurement.fadeOutMs ?? measurement.hideAfterMs ?? 1200);
|
|
1579
1579
|
return {
|
|
1580
1580
|
enabled: measurement.enabled === true,
|
|
1581
1581
|
transient: measurement.transient === true ||
|
|
1582
1582
|
measurement.showOnChangeOnly === true ||
|
|
1583
1583
|
measurement.visibleOnChangeOnly === true,
|
|
1584
|
-
fadeOutMs: Number.isFinite(fadeOutMs) ? Math.max(0, fadeOutMs) :
|
|
1584
|
+
fadeOutMs: Number.isFinite(fadeOutMs) ? Math.max(0, fadeOutMs) : 1200,
|
|
1585
1585
|
offsetPx: Number.isFinite(Number(measurement.offsetPx)) ? Number(measurement.offsetPx) : null
|
|
1586
1586
|
};
|
|
1587
1587
|
}
|
|
@@ -1595,14 +1595,15 @@ export class TimelineView {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
|
|
1597
1597
|
if (metrics.placement === "center") {
|
|
1598
|
-
|
|
1598
|
+
const side = this.direction === "rtl" ? -1 : 1;
|
|
1599
|
+
return clamp(metrics.axisCoordinate + side * offset, 18, metrics.width - 18);
|
|
1599
1600
|
}
|
|
1600
1601
|
|
|
1601
1602
|
const side = metrics.axisCoordinate < metrics.width / 2 ? 1 : -1;
|
|
1602
1603
|
return clamp(metrics.axisCoordinate + side * offset, 18, metrics.width - 18);
|
|
1603
1604
|
}
|
|
1604
1605
|
|
|
1605
|
-
showMeasurementLine({ persistent = false, fadeOutMs =
|
|
1606
|
+
showMeasurementLine({ persistent = false, fadeOutMs = 1200 } = {}) {
|
|
1606
1607
|
if (!this.measurementLine) return;
|
|
1607
1608
|
const wasHidden = this.measurementLine.hidden;
|
|
1608
1609
|
this.measurementLine.hidden = false;
|