@opendata-ai/openchart-engine 6.1.3 → 6.1.5
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/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/layout/axes.ts +3 -1
- package/src/tooltips/compute.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -6873,6 +6873,7 @@ var DEFAULT_COLLISION_PADDING = 5;
|
|
|
6873
6873
|
import {
|
|
6874
6874
|
abbreviateNumber as abbreviateNumber3,
|
|
6875
6875
|
buildD3Formatter as buildD3Formatter3,
|
|
6876
|
+
buildTemporalFormatter,
|
|
6876
6877
|
estimateTextWidth as estimateTextWidth7,
|
|
6877
6878
|
formatDate,
|
|
6878
6879
|
formatNumber as formatNumber3
|
|
@@ -6984,7 +6985,8 @@ var TEMPORAL_SCALE_TYPES = /* @__PURE__ */ new Set(["time", "utc"]);
|
|
|
6984
6985
|
function formatTickLabel(value, resolvedScale) {
|
|
6985
6986
|
const formatStr = resolvedScale.channel.axis?.format;
|
|
6986
6987
|
if (TEMPORAL_SCALE_TYPES.has(resolvedScale.type)) {
|
|
6987
|
-
|
|
6988
|
+
const temporalFmt = buildTemporalFormatter(formatStr);
|
|
6989
|
+
if (temporalFmt) return temporalFmt(value);
|
|
6988
6990
|
return formatDate(value);
|
|
6989
6991
|
}
|
|
6990
6992
|
if (NUMERIC_SCALE_TYPES.has(resolvedScale.type)) {
|
|
@@ -8550,10 +8552,12 @@ function compileTableLayout(spec, options, theme) {
|
|
|
8550
8552
|
}
|
|
8551
8553
|
|
|
8552
8554
|
// src/tooltips/compute.ts
|
|
8553
|
-
import { formatDate as formatDate3, formatNumber as formatNumber5 } from "@opendata-ai/openchart-core";
|
|
8555
|
+
import { buildTemporalFormatter as buildTemporalFormatter2, formatDate as formatDate3, formatNumber as formatNumber5 } from "@opendata-ai/openchart-core";
|
|
8554
8556
|
function formatValue(value, fieldType, format2) {
|
|
8555
8557
|
if (value == null) return "";
|
|
8556
8558
|
if (fieldType === "temporal" || value instanceof Date) {
|
|
8559
|
+
const temporalFmt = buildTemporalFormatter2(format2);
|
|
8560
|
+
if (temporalFmt) return temporalFmt(value);
|
|
8557
8561
|
return formatDate3(value);
|
|
8558
8562
|
}
|
|
8559
8563
|
if (typeof value === "number") {
|