@opendata-ai/openchart-core 6.15.1 → 6.17.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/locale/__tests__/format.test.ts +7 -0
- package/src/locale/format.ts +6 -1
- package/src/types/table.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ interface ColumnConfig {
|
|
|
149
149
|
flag?: boolean;
|
|
150
150
|
/** Category colors: color-code the cell based on its categorical value. */
|
|
151
151
|
categoryColors?: CategoryColorsConfig;
|
|
152
|
+
/** When true, auto-assign palette colors to values not in categoryColors. Default: false. */
|
|
153
|
+
autoAssign?: boolean;
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2464,7 +2464,11 @@ var D3_FORMAT_SUFFIX_RE = /^(.*~?[efgsrdxXobcnp%])(.+)$/;
|
|
|
2464
2464
|
function buildD3Formatter(formatStr) {
|
|
2465
2465
|
if (!formatStr) return null;
|
|
2466
2466
|
try {
|
|
2467
|
-
|
|
2467
|
+
const fmt = format(formatStr);
|
|
2468
|
+
if (formatStr.includes("s")) {
|
|
2469
|
+
return (v) => fmt(v).replace(/G$/, "B");
|
|
2470
|
+
}
|
|
2471
|
+
return fmt;
|
|
2468
2472
|
} catch {
|
|
2469
2473
|
const m = formatStr.match(D3_FORMAT_SUFFIX_RE);
|
|
2470
2474
|
if (m) {
|