@rowsncolumns/charts 28.1.17 → 28.1.19

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.
Files changed (90) hide show
  1. package/Readme.md +18 -1
  2. package/dist/cjs/basic-chart/basic-chart.d.ts +1 -1
  3. package/dist/cjs/basic-chart/basic-chart.d.ts.map +1 -1
  4. package/dist/cjs/basic-chart/basic-chart.js +371 -242
  5. package/dist/cjs/basic-chart/helpers.d.ts +7 -3
  6. package/dist/cjs/basic-chart/helpers.d.ts.map +1 -1
  7. package/dist/cjs/basic-chart/helpers.js +30 -4
  8. package/dist/cjs/basic-chart/index.d.ts +7 -0
  9. package/dist/cjs/basic-chart/index.d.ts.map +1 -1
  10. package/dist/cjs/basic-chart/index.js +19 -2
  11. package/dist/cjs/components/editors/chart-editor.d.ts +7 -1
  12. package/dist/cjs/components/editors/chart-editor.d.ts.map +1 -1
  13. package/dist/cjs/components/editors/chart-editor.js +24 -14
  14. package/dist/cjs/components/editors/fields/axis-options-fields.d.ts +6 -3
  15. package/dist/cjs/components/editors/fields/axis-options-fields.d.ts.map +1 -1
  16. package/dist/cjs/components/editors/fields/axis-options-fields.js +69 -7
  17. package/dist/cjs/components/editors/fields/chart-elements-fields.d.ts +15 -0
  18. package/dist/cjs/components/editors/fields/chart-elements-fields.d.ts.map +1 -0
  19. package/dist/cjs/components/editors/fields/chart-elements-fields.js +23 -0
  20. package/dist/cjs/components/editors/fields/series-format-fields.d.ts.map +1 -1
  21. package/dist/cjs/components/editors/fields/series-format-fields.js +16 -2
  22. package/dist/cjs/config.d.ts +10 -0
  23. package/dist/cjs/config.d.ts.map +1 -1
  24. package/dist/cjs/config.js +45 -10
  25. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  26. package/dist/cjs/types.d.ts +10 -0
  27. package/dist/cjs/types.d.ts.map +1 -1
  28. package/dist/cjs/utils/chart-lines.d.ts +36 -0
  29. package/dist/cjs/utils/chart-lines.d.ts.map +1 -0
  30. package/dist/cjs/utils/chart-lines.js +111 -0
  31. package/dist/cjs/utils/data-table.d.ts +31 -0
  32. package/dist/cjs/utils/data-table.d.ts.map +1 -0
  33. package/dist/cjs/utils/data-table.js +61 -0
  34. package/dist/cjs/utils/echarts-gl-loader.d.ts +6 -0
  35. package/dist/cjs/utils/echarts-gl-loader.d.ts.map +1 -1
  36. package/dist/cjs/utils/echarts-gl-loader.js +42 -1
  37. package/dist/cjs/utils/excel-axis-scale.d.ts +35 -0
  38. package/dist/cjs/utils/excel-axis-scale.d.ts.map +1 -0
  39. package/dist/cjs/utils/excel-axis-scale.js +210 -0
  40. package/dist/cjs/utils/overrides.d.ts +24 -3
  41. package/dist/cjs/utils/overrides.d.ts.map +1 -1
  42. package/dist/cjs/utils/overrides.js +119 -14
  43. package/dist/cjs/utils/three-d.d.ts +12 -1
  44. package/dist/cjs/utils/three-d.d.ts.map +1 -1
  45. package/dist/cjs/utils/three-d.js +4 -1
  46. package/dist/esm/basic-chart/basic-chart.d.ts +1 -1
  47. package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
  48. package/dist/esm/basic-chart/basic-chart.js +237 -73
  49. package/dist/esm/basic-chart/helpers.d.ts +7 -3
  50. package/dist/esm/basic-chart/helpers.d.ts.map +1 -1
  51. package/dist/esm/basic-chart/helpers.js +26 -3
  52. package/dist/esm/basic-chart/index.d.ts +7 -0
  53. package/dist/esm/basic-chart/index.d.ts.map +1 -1
  54. package/dist/esm/basic-chart/index.js +15 -1
  55. package/dist/esm/components/editors/chart-editor.d.ts +7 -1
  56. package/dist/esm/components/editors/chart-editor.d.ts.map +1 -1
  57. package/dist/esm/components/editors/chart-editor.js +16 -4
  58. package/dist/esm/components/editors/fields/axis-options-fields.d.ts +6 -3
  59. package/dist/esm/components/editors/fields/axis-options-fields.d.ts.map +1 -1
  60. package/dist/esm/components/editors/fields/axis-options-fields.js +56 -5
  61. package/dist/esm/components/editors/fields/chart-elements-fields.d.ts +15 -0
  62. package/dist/esm/components/editors/fields/chart-elements-fields.d.ts.map +1 -0
  63. package/dist/esm/components/editors/fields/chart-elements-fields.js +17 -0
  64. package/dist/esm/components/editors/fields/series-format-fields.d.ts.map +1 -1
  65. package/dist/esm/components/editors/fields/series-format-fields.js +9 -1
  66. package/dist/esm/config.d.ts +10 -0
  67. package/dist/esm/config.d.ts.map +1 -1
  68. package/dist/esm/config.js +20 -0
  69. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  70. package/dist/esm/types.d.ts +10 -0
  71. package/dist/esm/types.d.ts.map +1 -1
  72. package/dist/esm/utils/chart-lines.d.ts +36 -0
  73. package/dist/esm/utils/chart-lines.d.ts.map +1 -0
  74. package/dist/esm/utils/chart-lines.js +121 -0
  75. package/dist/esm/utils/data-table.d.ts +31 -0
  76. package/dist/esm/utils/data-table.d.ts.map +1 -0
  77. package/dist/esm/utils/data-table.js +48 -0
  78. package/dist/esm/utils/echarts-gl-loader.d.ts +6 -0
  79. package/dist/esm/utils/echarts-gl-loader.d.ts.map +1 -1
  80. package/dist/esm/utils/echarts-gl-loader.js +40 -0
  81. package/dist/esm/utils/excel-axis-scale.d.ts +35 -0
  82. package/dist/esm/utils/excel-axis-scale.d.ts.map +1 -0
  83. package/dist/esm/utils/excel-axis-scale.js +122 -0
  84. package/dist/esm/utils/overrides.d.ts +24 -3
  85. package/dist/esm/utils/overrides.d.ts.map +1 -1
  86. package/dist/esm/utils/overrides.js +111 -10
  87. package/dist/esm/utils/three-d.d.ts +12 -1
  88. package/dist/esm/utils/three-d.d.ts.map +1 -1
  89. package/dist/esm/utils/three-d.js +4 -1
  90. package/package.json +7 -7
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Excel's chart data table (Add Chart Element → Data Table,
3
+ * demo-app-monorepo#49969 FT-08): one row per series under the category
4
+ * axis, each cell under its category, the series name (with its legend key)
5
+ * at the row's start. Drawn as extra category axes stacked below the plot:
6
+ * their labels are the formatted values, their axis line the horizontal
7
+ * border and their ticks — between categories — the vertical borders.
8
+ */
9
+ /** Row height in pixels: 9 pt text plus padding. */
10
+ export const DATA_TABLE_ROW_HEIGHT = 20;
11
+ export const dataTableAxes = (rows, options, { textColor, fontSize, borderColor = "#D9D9D9", firstOffset = 22, }) => rows.map((row, index) => {
12
+ const keys = options.showLegendKeys !== false;
13
+ return {
14
+ type: "category",
15
+ position: "bottom",
16
+ gridIndex: 0,
17
+ offset: firstOffset + index * DATA_TABLE_ROW_HEIGHT,
18
+ data: row.values,
19
+ silent: true,
20
+ axisLine: {
21
+ show: options.showHorizontalBorder !== false ||
22
+ (options.showOutline !== false && index === rows.length - 1),
23
+ onZero: false,
24
+ lineStyle: { color: borderColor },
25
+ },
26
+ axisTick: {
27
+ show: options.showVerticalBorder !== false,
28
+ interval: 0,
29
+ length: DATA_TABLE_ROW_HEIGHT,
30
+ lineStyle: { color: borderColor },
31
+ },
32
+ axisLabel: { interval: 0, color: textColor, fontSize, margin: 6 },
33
+ splitLine: { show: false },
34
+ name: keys ? `{key|■} ${row.name}` : row.name,
35
+ nameLocation: "start",
36
+ nameGap: 8,
37
+ nameTextStyle: {
38
+ color: textColor,
39
+ fontSize,
40
+ align: "right",
41
+ verticalAlign: "top",
42
+ padding: [6, 0, 0, 0],
43
+ rich: { key: { color: row.color ?? textColor, fontSize } },
44
+ },
45
+ };
46
+ });
47
+ /** Room the row names need left of the plot (approximate glyph width). */
48
+ export const dataTableNameWidth = (rows, fontSize, legendKeys) => Math.ceil(rows.reduce((width, row) => Math.max(width, (row.name.length + (legendKeys ? 2 : 0)) * fontSize * 0.6), 0)) + 12;
@@ -1,5 +1,11 @@
1
1
  export type EchartsGlLoadState = "unloaded" | "loading" | "ready" | "failed";
2
2
  export declare const getEchartsGlState: () => EchartsGlLoadState;
3
+ /**
4
+ * Record that the loaded module failed at render time (echarts-gl threw
5
+ * from `setOption`), so the renderer keeps the 2-D fallback and never
6
+ * retries 3-D for the rest of the page's lifetime. Warns once per page.
7
+ */
8
+ export declare const markEchartsGlFailed: (error?: unknown) => void;
3
9
  /**
4
10
  * Kick off (or join) the echarts-gl dynamic import and register the 3-D
5
11
  * charts/components the renderer uses. Resolves true when 3-D rendering is
@@ -1 +1 @@
1
- {"version":3,"file":"echarts-gl-loader.d.ts","sourceRoot":"","sources":["../../../utils/echarts-gl-loader.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAK7E,eAAO,MAAM,iBAAiB,QAAO,kBAA2B,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,OAAO,CAyB/C,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,QAAO,IAGjD,CAAC"}
1
+ {"version":3,"file":"echarts-gl-loader.d.ts","sourceRoot":"","sources":["../../../utils/echarts-gl-loader.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAK7E,eAAO,MAAM,iBAAiB,QAAO,kBAA2B,CAAC;AAgBjE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,OAAO,KAAG,IAUrD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,OAAO,CA8B/C,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,QAAO,IAGjD,CAAC"}
@@ -7,12 +7,47 @@
7
7
  * draws the 2-D fallback immediately, and upgrades to 3-D when the module
8
8
  * resolves. A failed import latches the "failed" state so the renderer
9
9
  * keeps the 2-D fallback without retrying on every update.
10
+ *
11
+ * A page whose Content-Security-Policy has no `'unsafe-eval'` is treated
12
+ * the same way: echarts-gl's `EffectCompositor` makes claygl compile its
13
+ * size expressions with `new Function`, which the browser blocks there
14
+ * (`EvalError`, surfaced by claygl as "Invalid expression."). The import
15
+ * itself still succeeds, so the loader probes `new Function` once before
16
+ * importing and latches "failed" instead of letting `setOption` throw
17
+ * later (rowsncolumns/spreadsheet#1187).
10
18
  */
11
19
  import { VisualMapComponent } from "echarts/components";
12
20
  import * as echarts from "echarts/core";
13
21
  let state = "unloaded";
14
22
  let loadPromise = null;
15
23
  export const getEchartsGlState = () => state;
24
+ /**
25
+ * True when the page lets scripts construct functions from source — what
26
+ * claygl needs for every GL chart. False under a CSP whose `script-src`
27
+ * lacks `'unsafe-eval'`.
28
+ */
29
+ const canEvaluateCode = () => {
30
+ try {
31
+ new Function("");
32
+ return true;
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ };
38
+ /**
39
+ * Record that the loaded module failed at render time (echarts-gl threw
40
+ * from `setOption`), so the renderer keeps the 2-D fallback and never
41
+ * retries 3-D for the rest of the page's lifetime. Warns once per page.
42
+ */
43
+ export const markEchartsGlFailed = (error) => {
44
+ if (state !== "failed") {
45
+ // eslint-disable-next-line no-console
46
+ console.warn("echarts-gl failed to render a 3-D chart; 3-D charts render as their 2-D fallback on this page.", error);
47
+ }
48
+ state = "failed";
49
+ loadPromise = Promise.resolve(false);
50
+ };
16
51
  /**
17
52
  * Kick off (or join) the echarts-gl dynamic import and register the 3-D
18
53
  * charts/components the renderer uses. Resolves true when 3-D rendering is
@@ -20,6 +55,11 @@ export const getEchartsGlState = () => state;
20
55
  */
21
56
  export const loadEchartsGl = () => {
22
57
  if (!loadPromise) {
58
+ if (!canEvaluateCode()) {
59
+ state = "failed";
60
+ loadPromise = Promise.resolve(false);
61
+ return loadPromise;
62
+ }
23
63
  state = "loading";
24
64
  loadPromise = Promise.all([
25
65
  import("echarts-gl/charts"),
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Excel's automatic value-axis scale (Format Axis → Bounds / Units left on
3
+ * "Auto"). Excel does not publish the rule; this is the behaviour Jon Peltier
4
+ * measured ("How Excel Calculates Automatic Chart Axis Limits",
5
+ * peltiertech.com) and that LV-05 of demo-app-monorepo#49969 compared:
6
+ *
7
+ * - The minimum is 0 when every value is ≥ 0 and the data spans more than a
8
+ * sixth of the maximum (the mirror rule pins the maximum to 0 for an
9
+ * all-negative series); a narrower positive range starts half its span
10
+ * below the smallest value.
11
+ * - The maximum is the largest value plus 5% of the range, rounded up to the
12
+ * next major unit (so data ending at 17 gets an 18 ceiling, 100 gets 120).
13
+ * - The major unit is the smallest 1-2-5 step that splits the range into at
14
+ * most ten intervals.
15
+ *
16
+ * echarts' own nicing (1-2-3-5 steps aimed at five intervals) gives steps of
17
+ * 3 or 25 Excel never draws, so the renderer hands echarts these bounds.
18
+ */
19
+ export type ExcelAxisScale = {
20
+ min: number;
21
+ max: number;
22
+ interval: number;
23
+ };
24
+ export declare const excelAutoAxisScale: (values: Iterable<number>, fixed?: {
25
+ min?: number | null;
26
+ max?: number | null;
27
+ majorUnit?: number | null;
28
+ }) => ExcelAxisScale | undefined;
29
+ /**
30
+ * The values a cartesian value axis has to fit: every point of the bar / line
31
+ * series plotted against `axisIndex`, with stacked series summed per category
32
+ * (positives and negatives apart, as Excel stacks them).
33
+ */
34
+ export declare const valueAxisExtentValues: (series: ReadonlyArray<any>, axisIndex: number, axisKey?: "yAxisIndex" | "xAxisIndex") => number[];
35
+ //# sourceMappingURL=excel-axis-scale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excel-axis-scale.d.ts","sourceRoot":"","sources":["../../../utils/excel-axis-scale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAiB5E,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,QAAQ,CAAC,MAAM,CAAC,EACxB,QAAO;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,KAClF,cAAc,GAAG,SA6CnB,CAAC;AAYF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,aAAa,CAAC,GAAG,CAAC,EAC1B,WAAW,MAAM,EACjB,UAAS,YAAY,GAAG,YAA2B,KAClD,MAAM,EA6BR,CAAC"}
@@ -0,0 +1,122 @@
1
+ const MAX_INTERVALS = 10;
2
+ const niceSteps = (span) => {
3
+ const exponent = Math.floor(Math.log10(span / MAX_INTERVALS));
4
+ const steps = [];
5
+ for (let e = exponent - 1; e <= exponent + 2; e++) {
6
+ const base = 10 ** e;
7
+ steps.push(base, 2 * base, 5 * base);
8
+ }
9
+ return steps;
10
+ };
11
+ /** Floating-point safe multiple of `step` (`0.1 * 3` would print 0.30000000000000004). */
12
+ const multiple = (k, step) => Number((k * step).toPrecision(12));
13
+ export const excelAutoAxisScale = (values, fixed = {}) => {
14
+ let dataMin = Infinity;
15
+ let dataMax = -Infinity;
16
+ for (const v of values) {
17
+ if (!Number.isFinite(v))
18
+ continue;
19
+ if (v < dataMin)
20
+ dataMin = v;
21
+ if (v > dataMax)
22
+ dataMax = v;
23
+ }
24
+ if (!Number.isFinite(dataMin))
25
+ return undefined;
26
+ if (dataMin === dataMax) {
27
+ // One distinct value: Excel spans 0..value (or value..0).
28
+ if (dataMin > 0)
29
+ dataMin = 0;
30
+ else if (dataMax < 0)
31
+ dataMax = 0;
32
+ else
33
+ dataMax = 1;
34
+ }
35
+ const fixedMin = typeof fixed.min === "number" ? fixed.min : undefined;
36
+ const fixedMax = typeof fixed.max === "number" ? fixed.max : undefined;
37
+ let lo;
38
+ if (fixedMin !== undefined)
39
+ lo = fixedMin;
40
+ else if (dataMin >= 0)
41
+ lo = (dataMax - dataMin) / dataMax > 1 / 6 ? 0 : dataMin - (dataMax - dataMin) / 2;
42
+ else if (dataMax <= 0)
43
+ lo = dataMin - 0.05 * (0 - dataMin);
44
+ else
45
+ lo = dataMin - 0.05 * (dataMax - dataMin);
46
+ let hi;
47
+ if (fixedMax !== undefined)
48
+ hi = fixedMax;
49
+ else if (dataMax <= 0)
50
+ hi = (dataMax - dataMin) / -dataMin > 1 / 6 ? 0 : dataMax + (dataMax - dataMin) / 2;
51
+ else
52
+ hi = dataMax + 0.05 * (dataMax - lo);
53
+ if (!(hi > lo))
54
+ return undefined;
55
+ const pick = (step) => {
56
+ const min = fixedMin !== undefined ? fixedMin : multiple(Math.floor(lo / step), step);
57
+ const max = fixedMax !== undefined ? fixedMax : multiple(Math.ceil(hi / step), step);
58
+ return { min, max, interval: step };
59
+ };
60
+ if (typeof fixed.majorUnit === "number" && fixed.majorUnit > 0) {
61
+ return pick(fixed.majorUnit);
62
+ }
63
+ for (const step of niceSteps(hi - lo)) {
64
+ const scale = pick(step);
65
+ if ((scale.max - scale.min) / step <= MAX_INTERVALS + 1e-9)
66
+ return scale;
67
+ }
68
+ return undefined;
69
+ };
70
+ const pointValue = (item) => {
71
+ const raw = item !== null && typeof item === "object" && "value" in item
72
+ ? item.value
73
+ : item;
74
+ if (Array.isArray(raw))
75
+ return undefined;
76
+ const n = typeof raw === "number" ? raw : raw == null || raw === "" ? NaN : Number(raw);
77
+ return Number.isFinite(n) ? n : undefined;
78
+ };
79
+ /**
80
+ * The values a cartesian value axis has to fit: every point of the bar / line
81
+ * series plotted against `axisIndex`, with stacked series summed per category
82
+ * (positives and negatives apart, as Excel stacks them).
83
+ */
84
+ export const valueAxisExtentValues = (series, axisIndex, axisKey = "yAxisIndex") => {
85
+ const values = [];
86
+ const stacks = new Map();
87
+ for (const s of series) {
88
+ if (!s || (s.type !== "bar" && s.type !== "line"))
89
+ continue;
90
+ // High-low / drop lines and up/down bars only span the plotted values.
91
+ if (String(s.id ?? "").startsWith("rnc-chart-lines-"))
92
+ continue;
93
+ if ((s[axisKey] ?? 0) !== axisIndex || !Array.isArray(s.data))
94
+ continue;
95
+ if (s.stack === undefined) {
96
+ for (const item of s.data) {
97
+ const v = pointValue(item);
98
+ if (v !== undefined)
99
+ values.push(v);
100
+ }
101
+ continue;
102
+ }
103
+ const stack = stacks.get(s.stack) ?? { pos: [], neg: [] };
104
+ stacks.set(s.stack, stack);
105
+ s.data.forEach((item, i) => {
106
+ const v = pointValue(item);
107
+ if (v === undefined)
108
+ return;
109
+ const side = v >= 0 ? stack.pos : stack.neg;
110
+ side[i] = (side[i] ?? 0) + v;
111
+ });
112
+ }
113
+ for (const { pos, neg } of stacks.values()) {
114
+ for (const v of pos)
115
+ if (v !== undefined)
116
+ values.push(v);
117
+ for (const v of neg)
118
+ if (v !== undefined)
119
+ values.push(v);
120
+ }
121
+ return values;
122
+ };
@@ -7,6 +7,20 @@ import type { LegendComponentOption } from "echarts";
7
7
  * Underline / strikethrough have no canvas text decoration in echarts and
8
8
  * are not drawn.
9
9
  */
10
+ /**
11
+ * `ChartTextFormat.fontSize` is in points (OOXML `sz` / 100, the editor's
12
+ * Size field); echarts draws pixels. 9 pt → 12 px, 14 pt → 18.67 px.
13
+ */
14
+ export declare const pointsToPixels: (points: number) => number;
15
+ /** An authored point size as pixels, or `fallbackPx` when none is set. */
16
+ export declare const fontSizePx: (points: unknown, fallbackPx: number) => number;
17
+ /**
18
+ * Excel's chart text defaults (Office 2013+ chart styles): the theme's body
19
+ * (minor) font, 9 pt in Text 1 at 65% (#595959 on the light theme), and a
20
+ * 14 pt regular title (RD-24).
21
+ */
22
+ export declare const CHART_TEXT_PX: number;
23
+ export declare const CHART_TITLE_PX: number;
10
24
  export declare const themedTextStyle: (fmt: any, defaults: {
11
25
  color: string;
12
26
  fontSize: number;
@@ -15,19 +29,26 @@ export declare const themedTextStyle: (fmt: any, defaults: {
15
29
  }) => {
16
30
  color: any;
17
31
  fontFamily: any;
18
- fontSize: any;
32
+ fontSize: number;
19
33
  fontWeight: "bold" | "normal";
20
34
  fontStyle: "italic" | "normal";
21
35
  };
22
36
  /** Build an echarts `textStyle` from a parsed `ChartTextFormat`. */
23
37
  export declare const textFormatToEchartsTextStyle: (fmt: any) => Record<string, any> | undefined;
24
38
  export declare const applyLegendOverrides: (legend: LegendComponentOption, opts: any) => LegendComponentOption;
39
+ /** Excel's Format Axis → Display units: the divisor and the label it shows. */
40
+ export declare const DISPLAY_UNITS: Record<string, {
41
+ divisor: number;
42
+ label: string;
43
+ }>;
25
44
  /**
26
45
  * `numberFormatPattern` is the axis' RESOLVED format (explicit pattern or
27
46
  * the linked source-cell format — see `resolveValueAxisNumberFormat`); it
28
- * becomes the tick-label formatter.
47
+ * becomes the tick-label formatter. `placement` says which side of the plot
48
+ * the axis runs along (`x` horizontal, `y` vertical) for Excel's axis
49
+ * crossing; it defaults to `x` for a category axis and `y` for a value axis.
29
50
  */
30
- export declare const applyAxisOverrides: (axis: any, opts: any, numberFormatPattern?: string, locale?: string) => any;
51
+ export declare const applyAxisOverrides: (axis: any, opts: any, numberFormatPattern?: string, locale?: string, placement?: "x" | "y") => any;
31
52
  export declare const dataLabelFormatter: (opts: any, locale?: string, joiner?: string) => (params: any) => string;
32
53
  /**
33
54
  * The data-label options one series renders with: its own
@@ -1 +1 @@
1
- {"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../../utils/overrides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWrD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,GAAG,EACR,UAAU;IACR,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAChC;;;;gBASG,MAAM,GACN,QAAQ;eACsC,QAAQ,GAAG,QAAQ;CACrE,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,4BAA4B,GAAI,KAAK,GAAG,oCASpD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,qBAAqB,EAC7B,MAAM,GA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,QAAQ;eACsC,QAAQ,GAAG,QAAQ;CACrE,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,4BAA4B,GAAI,KAAK,GAAG,oCAWpD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,qBAAqB,EAC7B,MAAM,GAAG,KACR,qBA6CF,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAU5E,CAAC;AAKF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,GAAG,EACT,MAAM,GAAG,EACT,sBAAsB,MAAM,EAC5B,SAAS,MAAM,EACf,YAAY,GAAG,GAAG,GAAG,QAmGtB,CAAC;AAgBF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,GAAG,EACT,SAAS,MAAM,EAEf,eAAa,MACT,QAAQ,GAAG,WA0DhB,CAAC;AAgCF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,EACvC,YAAY,CAAC,GAAG,IAAI,GAAG,SAAS,EAChC,QAAQ;IAAE,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,KACnD,CAAC,GAAG,IAAI,GAAG,SAA6C,CAAC;AAE5D,eAAO,MAAM,sBAAsB,GACjC,MAAM,GAAG,EACT,aAAa,MAAM,EACnB,SAAS,MAAM;;;iCAxGH,GAAG;aA0HhB,CAAC"}
@@ -13,12 +13,24 @@ import { formatAxisValue, valueAxisLabelFormatter } from "./axis-number-format";
13
13
  * Underline / strikethrough have no canvas text decoration in echarts and
14
14
  * are not drawn.
15
15
  */
16
+ /**
17
+ * `ChartTextFormat.fontSize` is in points (OOXML `sz` / 100, the editor's
18
+ * Size field); echarts draws pixels. 9 pt → 12 px, 14 pt → 18.67 px.
19
+ */
20
+ export const pointsToPixels = (points) => Math.round(((points * 4) / 3) * 100) / 100;
21
+ /** An authored point size as pixels, or `fallbackPx` when none is set. */
22
+ export const fontSizePx = (points, fallbackPx) => typeof points === "number" && points > 0 ? pointsToPixels(points) : fallbackPx;
23
+ /**
24
+ * Excel's chart text defaults (Office 2013+ chart styles): the theme's body
25
+ * (minor) font, 9 pt in Text 1 at 65% (#595959 on the light theme), and a
26
+ * 14 pt regular title (RD-24).
27
+ */
28
+ export const CHART_TEXT_PX = pointsToPixels(9);
29
+ export const CHART_TITLE_PX = pointsToPixels(14);
16
30
  export const themedTextStyle = (fmt, defaults) => ({
17
31
  color: fmt?.color ?? defaults.color,
18
32
  fontFamily: fmt?.fontFamily ?? defaults.fontFamily ?? "sans-serif",
19
- fontSize: typeof fmt?.fontSize === "number" && fmt.fontSize > 0
20
- ? fmt.fontSize
21
- : defaults.fontSize,
33
+ fontSize: fontSizePx(fmt?.fontSize, defaults.fontSize),
22
34
  fontWeight: (fmt ? (fmt.bold ? "bold" : "normal") : defaults.fontWeight ?? "normal"),
23
35
  fontStyle: (fmt?.italic ? "italic" : "normal"),
24
36
  });
@@ -31,8 +43,9 @@ export const textFormatToEchartsTextStyle = (fmt) => {
31
43
  result.color = fmt.color;
32
44
  if (fmt.fontFamily)
33
45
  result.fontFamily = fmt.fontFamily;
34
- if (typeof fmt.fontSize === "number")
35
- result.fontSize = fmt.fontSize;
46
+ if (typeof fmt.fontSize === "number" && fmt.fontSize > 0) {
47
+ result.fontSize = pointsToPixels(fmt.fontSize);
48
+ }
36
49
  if (fmt.bold)
37
50
  result.fontWeight = "bold";
38
51
  if (fmt.italic)
@@ -86,13 +99,35 @@ export const applyLegendOverrides = (legend, opts) => {
86
99
  }
87
100
  return next;
88
101
  };
102
+ /** Excel's Format Axis → Display units: the divisor and the label it shows. */
103
+ export const DISPLAY_UNITS = {
104
+ hundreds: { divisor: 1e2, label: "Hundreds" },
105
+ thousands: { divisor: 1e3, label: "Thousands" },
106
+ tenThousands: { divisor: 1e4, label: "10000" },
107
+ hundredThousands: { divisor: 1e5, label: "100000" },
108
+ millions: { divisor: 1e6, label: "Millions" },
109
+ tenMillions: { divisor: 1e7, label: "10000000" },
110
+ hundredMillions: { divisor: 1e8, label: "100000000" },
111
+ billions: { divisor: 1e9, label: "Billions" },
112
+ trillions: { divisor: 1e12, label: "Trillions" },
113
+ };
114
+ const positive = (v) => typeof v === "number" && Number.isFinite(v) && v > 0;
89
115
  /**
90
116
  * `numberFormatPattern` is the axis' RESOLVED format (explicit pattern or
91
117
  * the linked source-cell format — see `resolveValueAxisNumberFormat`); it
92
- * becomes the tick-label formatter.
118
+ * becomes the tick-label formatter. `placement` says which side of the plot
119
+ * the axis runs along (`x` horizontal, `y` vertical) for Excel's axis
120
+ * crossing; it defaults to `x` for a category axis and `y` for a value axis.
93
121
  */
94
- export const applyAxisOverrides = (axis, opts, numberFormatPattern, locale) => {
95
- const formatter = valueAxisLabelFormatter(numberFormatPattern, locale);
122
+ export const applyAxisOverrides = (axis, opts, numberFormatPattern, locale, placement) => {
123
+ const units = opts?.displayUnits ? DISPLAY_UNITS[opts.displayUnits] : undefined;
124
+ const baseFormatter = valueAxisLabelFormatter(numberFormatPattern, locale);
125
+ // Display units divide the tick labels: 25,000 on a "Thousands" axis reads 25.
126
+ const formatter = units
127
+ ? (value) => typeof value === "number"
128
+ ? (baseFormatter ?? ((v) => formatAxisValue(undefined, v, locale)))(value / units.divisor)
129
+ : String(value ?? "")
130
+ : baseFormatter;
96
131
  if (!opts && !formatter)
97
132
  return axis;
98
133
  const next = { ...axis };
@@ -101,8 +136,11 @@ export const applyAxisOverrides = (axis, opts, numberFormatPattern, locale) => {
101
136
  }
102
137
  if (!opts)
103
138
  return next;
104
- if (opts.logarithmic)
139
+ const isValueAxis = next.type !== "category";
140
+ if (opts.logarithmic) {
105
141
  next.type = "log";
142
+ next.logBase = positive(opts.logBase) && opts.logBase >= 2 ? opts.logBase : 10;
143
+ }
106
144
  if (opts.reverse)
107
145
  next.inverse = true;
108
146
  if (typeof opts.min === "number")
@@ -117,6 +155,62 @@ export const applyAxisOverrides = (axis, opts, numberFormatPattern, locale) => {
117
155
  if (opts.showMajorGridlines === true) {
118
156
  next.splitLine = { ...(next.splitLine ?? {}), show: true };
119
157
  }
158
+ // Format Axis → Units (FT-08). A value axis' major unit is the tick
159
+ // interval; minor ticks / gridlines split it by major ÷ minor (Excel's
160
+ // automatic minor unit is a fifth of the major).
161
+ if (isValueAxis && positive(opts.majorUnit) && !opts.logarithmic) {
162
+ next.interval = opts.majorUnit;
163
+ }
164
+ const minorSplit = positive(opts.majorUnit) && positive(opts.minorUnit)
165
+ ? Math.max(1, Math.round(opts.majorUnit / opts.minorUnit))
166
+ : 5;
167
+ const minorTicks = typeof opts.minorTickMark === "string" && opts.minorTickMark !== "none";
168
+ if (isValueAxis && (minorTicks || opts.showMinorGridlines)) {
169
+ next.minorTick = { show: minorTicks, splitNumber: minorSplit };
170
+ }
171
+ if (isValueAxis && opts.showMinorGridlines) {
172
+ next.minorSplitLine = { show: true, lineStyle: { color: "#F2F2F2" } };
173
+ }
174
+ // Format Axis → Tick Marks: none / inside / outside / cross.
175
+ if (opts.majorTickMark === "none") {
176
+ next.axisTick = { ...(next.axisTick ?? {}), show: false };
177
+ }
178
+ else if (opts.majorTickMark === "in") {
179
+ next.axisTick = { ...(next.axisTick ?? {}), show: true, inside: true };
180
+ }
181
+ else if (opts.majorTickMark === "cross") {
182
+ next.axisTick = { ...(next.axisTick ?? {}), show: true, inside: false, length: 8 };
183
+ }
184
+ // Category axis "Interval between labels / tick marks": every Nth category.
185
+ if (!isValueAxis && positive(opts.tickLabelSkip)) {
186
+ next.axisLabel = {
187
+ ...(next.axisLabel ?? {}),
188
+ interval: Math.round(opts.tickLabelSkip) - 1,
189
+ };
190
+ }
191
+ if (!isValueAxis && positive(opts.tickMarkSkip)) {
192
+ next.axisTick = {
193
+ ...(next.axisTick ?? {}),
194
+ interval: Math.round(opts.tickMarkSkip) - 1,
195
+ };
196
+ }
197
+ // Where this axis crosses the perpendicular one (OOXML's `<c:crosses>` /
198
+ // `<c:crossesAt>` on this axis). echarts places an axis at the other's zero
199
+ // or at either plot edge, so a `crossesAt` other than 0 draws at the edge.
200
+ const side = placement ?? (isValueAxis ? "y" : "x");
201
+ if (opts.crosses === "max") {
202
+ next.position = side === "x" ? "top" : "right";
203
+ next.axisLine = { ...(next.axisLine ?? {}), onZero: false };
204
+ }
205
+ else if (opts.crosses === "min" ||
206
+ (typeof opts.crossesAt === "number" && opts.crossesAt !== 0)) {
207
+ next.position = side === "x" ? "bottom" : "left";
208
+ next.axisLine = { ...(next.axisLine ?? {}), onZero: false };
209
+ }
210
+ // The display-units label ("Thousands") rides with the axis title.
211
+ if (units && opts.showDisplayUnitsLabel !== false) {
212
+ next.name = next.name ? `${next.name} (${units.label})` : units.label;
213
+ }
120
214
  // Axis label text style (tick labels) + axis title font come from
121
215
  // <c:txPr>. Without this echarts uses its default (~black on light).
122
216
  const axisTextStyle = textFormatToEchartsTextStyle(opts.textFormat);
@@ -138,6 +232,12 @@ export const dataLabelFormatter = (opts, locale,
138
232
  // A treemap block stacks the parts (name, value) on their own lines.
139
233
  joiner = ": ") => (params) => {
140
234
  const parts = [];
235
+ // Value From Cells (FT-08): the point's cell leads; resolved by the caller.
236
+ if (Array.isArray(opts.cellLabels)) {
237
+ const cell = opts.cellLabels[params.dataIndex];
238
+ if (cell !== undefined && cell !== null && cell !== "")
239
+ parts.push(String(cell));
240
+ }
141
241
  if (opts.showSeriesName && params.seriesName)
142
242
  parts.push(params.seriesName);
143
243
  if (opts.showCategoryName && params.name)
@@ -153,7 +253,8 @@ joiner = ": ") => (params) => {
153
253
  !opts.showCategoryName &&
154
254
  !opts.showPercent &&
155
255
  !opts.showSeriesName &&
156
- !opts.showBubbleSize
256
+ !opts.showBubbleSize &&
257
+ !Array.isArray(opts.cellLabels)
157
258
  ? true
158
259
  : !!opts.showValue;
159
260
  // A scatter / bubble point's value is its [x, y, size] tuple: the label's
@@ -44,14 +44,25 @@ export declare const normalize3DSourceType: (sourceChartType?: string | null) =>
44
44
  export declare const is3DSpec: (spec: {
45
45
  sourceChartType?: string | null;
46
46
  } | null | undefined) => boolean;
47
+ /** Host opt-out of the WebGL pipeline (`enable3D` on the renderer / editor). */
48
+ export type ThreeDRenderOptions = {
49
+ /**
50
+ * `false` keeps every spec on its 2-D fallback: echarts-gl is never
51
+ * loaded and the Chart editor offers no echarts-gl preset. The spec's
52
+ * `sourceChartType` is untouched, so the xlsx export still writes the
53
+ * 3-D chart (rowsncolumns/spreadsheet#1187). Default `true`.
54
+ */
55
+ enable3D?: boolean;
56
+ };
47
57
  /**
48
58
  * Map a `sourceChartType` token to the echarts-gl series kind it renders
49
59
  * as, or null when the 3-D pipeline should not run:
50
60
  * - PIE_3D — echarts-gl has no pie3D, so the 2-D pie fallback stays.
51
61
  * - AREA_3D — echarts-gl has no area3D; rendered as line3D.
52
62
  * - non-3-D / unknown tokens.
63
+ * - any token when the host turned 3-D off (`enable3D: false`).
53
64
  */
54
- export declare const resolve3DRenderKind: (sourceChartType?: string | null) => ThreeDRenderKind | null;
65
+ export declare const resolve3DRenderKind: (sourceChartType?: string | null, options?: ThreeDRenderOptions) => ThreeDRenderKind | null;
55
66
  /** Excel's Contour: the surface grid seen from above, as a flat heatmap. */
56
67
  export declare const isContourSpec: (spec: {
57
68
  sourceChartType?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"three-d.d.ts","sourceRoot":"","sources":["../../../utils/three-d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,QAAA,MAAM,cAAc,8EAOV,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAI9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC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) !
58
58
  * - PIE_3D — echarts-gl has no pie3D, so the 2-D pie fallback stays.
59
59
  * - AREA_3D — echarts-gl has no area3D; rendered as line3D.
60
60
  * - non-3-D / unknown tokens.
61
+ * - any token when the host turned 3-D off (`enable3D: false`).
61
62
  */
62
- export const resolve3DRenderKind = (sourceChartType) => {
63
+ export const resolve3DRenderKind = (sourceChartType, options) => {
64
+ if (options?.enable3D === false)
65
+ return null;
63
66
  switch (normalize3DSourceType(sourceChartType)) {
64
67
  case "BAR_3D":
65
68
  return "bar3D";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/charts",
3
- "version": "28.1.17",
3
+ "version": "28.1.19",
4
4
  "author": "Vinay M",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "./dist/cjs/index.js",
@@ -67,14 +67,14 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@rowsncolumns/calculator": ">=7.3.1",
70
- "@rowsncolumns/common-types": ">=5.3.2",
71
- "@rowsncolumns/grid": ">=13.2.35",
70
+ "@rowsncolumns/common-types": ">=5.4.0",
71
+ "@rowsncolumns/grid": ">=13.4.0",
72
72
  "@rowsncolumns/icons": ">=7.2.33",
73
- "@rowsncolumns/spreadsheet": ">=10.4.13",
74
- "@rowsncolumns/spreadsheet-state": ">=29.1.8",
73
+ "@rowsncolumns/spreadsheet": ">=10.8.0",
74
+ "@rowsncolumns/spreadsheet-state": ">=29.4.0",
75
75
  "@rowsncolumns/toolkit": ">=24.5.14",
76
- "@rowsncolumns/ui": ">=16.0.4",
77
- "@rowsncolumns/utils": ">=9.5.5",
76
+ "@rowsncolumns/ui": ">=16.2.0",
77
+ "@rowsncolumns/utils": ">=9.7.0",
78
78
  "@types/react-plotly.js": "^2.6.3",
79
79
  "echarts": "^5.6.0",
80
80
  "formik": "^2.4.6",