@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
@@ -1,5 +1,12 @@
1
1
  import React from "react";
2
2
  import type { EChartComponentProps } from "../types";
3
+ /**
4
+ * Excel's chart area outline: a thin Text 1 at 15% line (#D9D9D9), no drop
5
+ * shadow (LV-05). A chart with its own Format Chart Area border
6
+ * (`EmbeddedChart.borderColor`) is outlined by the grid's embed frame
7
+ * instead, so it gets none here.
8
+ */
9
+ export declare const chartFrameBorder: (chart: EChartComponentProps["chart"], isDarkMode?: boolean) => string | undefined;
3
10
  export declare const ChartComponent: (props: EChartComponentProps) => React.JSX.Element;
4
11
  export default ChartComponent;
5
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../basic-chart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,eAAO,MAAM,cAAc,GAAI,OAAO,oBAAoB,sBAMzD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../basic-chart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,oBAAoB,CAAC,OAAO,CAAC,EACpC,aAAa,OAAO,KACnB,MAAM,GAAG,SAGyD,CAAC;AAEtE,eAAO,MAAM,cAAc,GAAI,OAAO,oBAAoB,sBAazD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,7 +1,21 @@
1
1
  import React from "react";
2
2
  import { BasicChart } from "./basic-chart";
3
+ /**
4
+ * Excel's chart area outline: a thin Text 1 at 15% line (#D9D9D9), no drop
5
+ * shadow (LV-05). A chart with its own Format Chart Area border
6
+ * (`EmbeddedChart.borderColor`) is outlined by the grid's embed frame
7
+ * instead, so it gets none here.
8
+ */
9
+ export const chartFrameBorder = (chart, isDarkMode) => chart?.borderColor
10
+ ? undefined
11
+ : `1px solid ${isDarkMode ? "rgba(255,255,255,0.2)" : "#D9D9D9"}`;
3
12
  export const ChartComponent = (props) => {
4
- return (React.createElement("div", { className: "shadow-lg bg-rnc-background flex-1 flex break-words flex-col" },
13
+ return (React.createElement("div", { className: "bg-rnc-background flex-1 flex break-words flex-col",
14
+ // An inset outline: drawn over the plot's edge without shrinking it.
15
+ style: {
16
+ outline: chartFrameBorder(props.chart, props.isDarkMode),
17
+ outlineOffset: -1,
18
+ } },
5
19
  React.createElement(BasicChart, { ...props })));
6
20
  };
7
21
  export default ChartComponent;
@@ -16,7 +16,13 @@ type ChartEditorProps = {
16
16
  * from the data range. Without it the switched series are unnamed.
17
17
  */
18
18
  getFormattedValue?: ChartCellLabelGetter;
19
+ /**
20
+ * Mirror of the renderer's `enable3D`: `false` hides the presets that
21
+ * render through echarts-gl (3-D Column / Bar / Line / Area / Surface).
22
+ * An existing 3-D spec keeps its `sourceChartType`. Default `true`.
23
+ */
24
+ enable3D?: boolean;
19
25
  };
20
- export declare const ChartEditor: ({ chart, sheetId, onSubmit, onRequestMoveChart, getFormattedValue, }: ChartEditorProps) => React.JSX.Element;
26
+ export declare const ChartEditor: ({ chart, sheetId, onSubmit, onRequestMoveChart, getFormattedValue, enable3D, }: ChartEditorProps) => React.JSX.Element;
21
27
  export default ChartEditor;
22
28
  //# sourceMappingURL=chart-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-editor.d.ts","sourceRoot":"","sources":["../../../../components/editors/chart-editor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,aAAa,EAGd,MAAM,2BAA2B,CAAC;AAwBnC,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,+BAA+B,CAAC;AAuDvC,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC;;;;OAIG;IACH,kBAAkB,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,CAAC;CAC1C,CAAC;AAuBF,eAAO,MAAM,WAAW,GAAI,sEAMzB,gBAAgB,sBAkhClB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"chart-editor.d.ts","sourceRoot":"","sources":["../../../../components/editors/chart-editor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,aAAa,EAGd,MAAM,2BAA2B,CAAC;AAwBnC,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,+BAA+B,CAAC;AAwDvC,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC;;;;OAIG;IACH,kBAAkB,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAuBF,eAAO,MAAM,WAAW,GAAI,gFAOzB,gBAAgB,sBAujClB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -7,13 +7,14 @@ import { uuid } from "@rowsncolumns/utils";
7
7
  import { useFormik } from "formik";
8
8
  import React, { useMemo } from "react";
9
9
  import { useSetChartEditorDialogState } from "../../atoms/editing-chart.atom";
10
- import { CHART_TYPES, getChartPresetLabel } from "../../config";
10
+ import { getChartPresetLabel, getChartTypes } from "../../config";
11
11
  import { canSwitchRowColumn, inferSeriesOrientation, switchRowColumn, } from "../../utils/chart-orientation";
12
12
  import { isBasicChartSpec, isBubbleChartSpec, isHierarchyChartSpec, mergeChartSpec, } from "../../utils/chart-spec-utils";
13
13
  import { applyChartColorPalette, applyChartQuickLayout, applyChartStyle, CHART_COLOR_PALETTES, CHART_QUICK_LAYOUTS, CHART_STYLES, resetChartToMatchStyle, } from "../../utils/chart-styles";
14
14
  import { getChartEditorCapabilities } from "./chart-editor-capabilities";
15
15
  import { ChartRangeInput } from "./chart-range-input";
16
16
  import { AxisOptionsFields } from "./fields/axis-options-fields";
17
+ import { ChartElementsFields } from "./fields/chart-elements-fields";
17
18
  import { chartTypeHasOptions, ChartTypeOptionsFields, } from "./fields/chart-type-options";
18
19
  import { DataLabelsFields } from "./fields/data-labels-fields";
19
20
  import { SeriesFormatFields } from "./fields/series-format-fields";
@@ -47,8 +48,9 @@ const Section = ({ title, defaultOpen = false, children, }) => (React.createElem
47
48
  React.createElement(ChevronRightIcon, { className: "shrink-0 transition-transform group-open:rotate-90" }),
48
49
  title),
49
50
  React.createElement("div", { className: "flex flex-col gap-2 pb-3" }, children)));
50
- export const ChartEditor = ({ chart, sheetId, onSubmit, onRequestMoveChart, getFormattedValue, }) => {
51
+ export const ChartEditor = ({ chart, sheetId, onSubmit, onRequestMoveChart, getFormattedValue, enable3D, }) => {
51
52
  const setChartDialogState = useSetChartEditorDialogState();
53
+ const chartTypes = getChartTypes({ enable3D });
52
54
  // Close dialog
53
55
  const closeDialog = () => setChartDialogState(false);
54
56
  // Keyed on chart identity so a position sync (move/resize while the
@@ -218,7 +220,7 @@ export const ChartEditor = ({ chart, sheetId, onSubmit, onRequestMoveChart, getF
218
220
  React.createElement(DropdownRightSlot, null,
219
221
  React.createElement(TriangleDownIcon, null)))),
220
222
  React.createElement(DropdownMenuPortal, null,
221
- React.createElement(DropdownMenuContent, { align: "start", sideOffset: 0 }, CHART_TYPES.map(([category, types]) => {
223
+ React.createElement(DropdownMenuContent, { align: "start", sideOffset: 0 }, chartTypes.map(([category, types]) => {
222
224
  return (React.createElement(DropdownMenuSub, { key: category },
223
225
  React.createElement(DropdownMenuSubTrigger, null,
224
226
  React.createElement(DropdownLeftSlot, null,
@@ -321,7 +323,14 @@ export const ChartEditor = ({ chart, sheetId, onSubmit, onRequestMoveChart, getF
321
323
  React.createElement(Section, { title: "Chart style", defaultOpen: true },
322
324
  React.createElement(Stack, { direction: "vertical", className: "gap-1 pb-2" },
323
325
  React.createElement("label", { className: "font-system text-sm" }, "Chart title"),
324
- React.createElement(Input, { value: values?.spec.title ?? "", type: "text", onChange: (e) => setFieldValue(`spec.title`, e.target.value), className: "text-xs", placeholder: "Enter chart title" })),
326
+ React.createElement(Input, { value: values?.spec.title ?? "", type: "text", onChange: (e) => setFieldValue(`spec.title`, e.target.value), className: "text-xs", placeholder: "Enter chart title" }),
327
+ React.createElement("label", { className: "font-system text-xs" }, "Link title to cell"),
328
+ React.createElement(ChartRangeInput, { sheetId: sheetId, range: values.spec.titleSource ?? undefined, onChangeRange: (titleSource) => setFieldValue("spec.titleSource", {
329
+ ...titleSource,
330
+ endRowIndex: titleSource.startRowIndex,
331
+ endColumnIndex: titleSource.startColumnIndex,
332
+ }), placeholder: "Select a cell", className: "mb-0" }),
333
+ values.spec.titleSource ? (React.createElement("button", { type: "button", className: "font-system text-xs text-rnc-muted-foreground underline self-start", onClick: () => setFieldValue("spec.titleSource", undefined) }, "Unlink title")) : null),
325
334
  React.createElement(Stack, { direction: "vertical", className: "gap-1 pb-2" },
326
335
  React.createElement("label", { className: "font-system text-sm" }, "Subtitle"),
327
336
  React.createElement(Input, { value: values.spec.subtitle ?? "", type: "text", onChange: (e) => setFieldValue("spec.subtitle", e.target.value || undefined), className: "text-xs", placeholder: "Enter chart subtitle", "aria-label": "Chart subtitle" })),
@@ -399,6 +408,9 @@ export const ChartEditor = ({ chart, sheetId, onSubmit, onRequestMoveChart, getF
399
408
  React.createElement("label", { className: "font-system text-sm" }, "Horizontal axis title"),
400
409
  React.createElement(Input, { value: values?.spec.horizontalAxisTitle ?? "", type: "text", onChange: (e) => setFieldValue(`spec.horizontalAxisTitle`, e.target.value), className: "text-xs", placeholder: "Horizontal axis title" }))) : null,
401
410
  caps.hasCategoryAxis ? (React.createElement(AxisOptionsFields, { label: "Category axis", kind: caps.category === "bubble" ? "value" : "category", value: values.spec.categoryAxisOptions, gridlinesDefault: false, onChange: (next) => setFieldValue("spec.categoryAxisOptions", next) })) : null)) : null,
411
+ caps.hasValueAxis &&
412
+ ["line", "area", "column", "combo"].includes(values.spec.chartType) ? (React.createElement(Section, { title: "Chart elements" },
413
+ React.createElement(ChartElementsFields, { chartType: values.spec.chartType, spec: values.spec, onChange: (key, value) => setFieldValue(`spec.${key}`, value) }))) : null,
402
414
  caps.hasDataLabels ? (React.createElement(Section, { title: "Data labels" },
403
415
  React.createElement(DataLabelsFields, { value: values.spec.dataLabels, capabilities: caps, onChange: (dataLabels) => setFieldValue("spec.dataLabels", dataLabels) }))) : null,
404
416
  hasTypeOptions ? (React.createElement(Section, { title: "Chart options" },
@@ -1,9 +1,12 @@
1
1
  import type { ChartAxisOptions } from "@rowsncolumns/spreadsheet";
2
2
  import React from "react";
3
3
  /**
4
- * One axis' options (`ChartAxisOptions`): a value axis has a scale
5
- * (min / max / logarithmic), both have direction, gridlines, visibility
6
- * and tick-label font; a value axis also has its number format.
4
+ * One axis' options (`ChartAxisOptions`) — Excel's Format Axis pane
5
+ * (demo-app-monorepo#49969 FT-08): a value axis has its bounds, log scale
6
+ * and base, major / minor units, display units and number format; a
7
+ * category axis its label / tick-mark intervals; both have where the other
8
+ * axis crosses, direction, major / minor gridlines, tick marks, visibility
9
+ * and tick-label font.
7
10
  */
8
11
  export declare const AxisOptionsFields: ({ label, kind, value, onChange, gridlinesDefault, }: {
9
12
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"axis-options-fields.d.ts","sourceRoot":"","sources":["../../../../../components/editors/fields/axis-options-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,qDAM/B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,sBAoEA,CAAC"}
1
+ {"version":3,"file":"axis-options-fields.d.ts","sourceRoot":"","sources":["../../../../../components/editors/fields/axis-options-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAgC1B;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,qDAM/B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3B,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,sBAkNA,CAAC"}
@@ -1,10 +1,31 @@
1
1
  import React from "react";
2
- import { CheckboxField, NumberField, TextField } from "./primitives";
2
+ import { CheckboxField, NumberField, SelectField, TextField, } from "./primitives";
3
3
  import { TextFormatFields } from "./text-format-fields";
4
+ const TICK_MARKS = [
5
+ { value: "none", label: "None" },
6
+ { value: "in", label: "Inside" },
7
+ { value: "out", label: "Outside" },
8
+ { value: "cross", label: "Cross" },
9
+ ];
10
+ const DISPLAY_UNIT_OPTIONS = [
11
+ { value: "", label: "None" },
12
+ { value: "hundreds", label: "Hundreds" },
13
+ { value: "thousands", label: "Thousands" },
14
+ { value: "tenThousands", label: "10000" },
15
+ { value: "hundredThousands", label: "100000" },
16
+ { value: "millions", label: "Millions" },
17
+ { value: "tenMillions", label: "10000000" },
18
+ { value: "hundredMillions", label: "100000000" },
19
+ { value: "billions", label: "Billions" },
20
+ { value: "trillions", label: "Trillions" },
21
+ ];
4
22
  /**
5
- * One axis' options (`ChartAxisOptions`): a value axis has a scale
6
- * (min / max / logarithmic), both have direction, gridlines, visibility
7
- * and tick-label font; a value axis also has its number format.
23
+ * One axis' options (`ChartAxisOptions`) — Excel's Format Axis pane
24
+ * (demo-app-monorepo#49969 FT-08): a value axis has its bounds, log scale
25
+ * and base, major / minor units, display units and number format; a
26
+ * category axis its label / tick-mark intervals; both have where the other
27
+ * axis crosses, direction, major / minor gridlines, tick marks, visibility
28
+ * and tick-label font.
8
29
  */
9
30
  export const AxisOptionsFields = ({ label, kind, value, onChange, gridlinesDefault = true, }) => {
10
31
  const set = (patch) => onChange({ ...(value ?? {}), ...patch });
@@ -13,9 +34,39 @@ export const AxisOptionsFields = ({ label, kind, value, onChange, gridlinesDefau
13
34
  kind === "value" ? (React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
14
35
  React.createElement(NumberField, { label: "Min", ariaLabel: `${label} min`, value: value?.min, onChange: (min) => set({ min }), placeholder: "Auto" }),
15
36
  React.createElement(NumberField, { label: "Max", ariaLabel: `${label} max`, value: value?.max, onChange: (max) => set({ max }), placeholder: "Auto" }))) : null,
16
- kind === "value" ? (React.createElement(CheckboxField, { label: "Logarithmic scale", ariaLabel: `${label} logarithmic scale`, checked: Boolean(value?.logarithmic), onChange: (on) => set({ logarithmic: on || undefined }) })) : null,
37
+ kind === "value" ? (React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
38
+ React.createElement(NumberField, { label: "Major unit", ariaLabel: `${label} major unit`, value: value?.majorUnit, min: 0, onChange: (majorUnit) => set({ majorUnit }), placeholder: "Auto" }),
39
+ React.createElement(NumberField, { label: "Minor unit", ariaLabel: `${label} minor unit`, value: value?.minorUnit, min: 0, onChange: (minorUnit) => set({ minorUnit }), placeholder: "Auto" }))) : (React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
40
+ React.createElement(NumberField, { label: "Label interval", ariaLabel: `${label} interval between labels`, value: value?.tickLabelSkip, min: 1, step: 1, onChange: (tickLabelSkip) => set({ tickLabelSkip }), placeholder: "Auto" }),
41
+ React.createElement(NumberField, { label: "Tick interval", ariaLabel: `${label} interval between tick marks`, value: value?.tickMarkSkip, min: 1, step: 1, onChange: (tickMarkSkip) => set({ tickMarkSkip }), placeholder: "1" }))),
42
+ kind === "value" ? (React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
43
+ React.createElement(CheckboxField, { label: "Logarithmic scale", ariaLabel: `${label} logarithmic scale`, checked: Boolean(value?.logarithmic), onChange: (on) => set({ logarithmic: on || undefined }) }),
44
+ value?.logarithmic ? (React.createElement(NumberField, { label: "Base", ariaLabel: `${label} logarithmic base`, value: value?.logBase, min: 2, max: 1000, onChange: (logBase) => set({ logBase }), placeholder: "10" })) : null)) : null,
45
+ kind === "value" ? (React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
46
+ React.createElement(SelectField, { label: "Display units", ariaLabel: `${label} display units`, value: (value?.displayUnits ?? ""), options: DISPLAY_UNIT_OPTIONS, onChange: (unit) => set({ displayUnits: unit === "" ? undefined : unit }) }),
47
+ value?.displayUnits ? (React.createElement(CheckboxField, { label: "Show display units label", ariaLabel: `${label} show display units label`, checked: value?.showDisplayUnitsLabel !== false, onChange: (on) => set({ showDisplayUnitsLabel: on ? undefined : false }) })) : null)) : null,
48
+ React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
49
+ React.createElement(SelectField, { label: "Crosses other axis", ariaLabel: `${label} crosses`, value: typeof value?.crossesAt === "number"
50
+ ? "value"
51
+ : value?.crosses === "max"
52
+ ? "max"
53
+ : "autoZero", options: [
54
+ { value: "autoZero", label: "Automatic" },
55
+ { value: "value", label: "At value" },
56
+ { value: "max", label: "At maximum" },
57
+ ], onChange: (crossing) => set(crossing === "value"
58
+ ? { crosses: undefined, crossesAt: value?.crossesAt ?? 0 }
59
+ : {
60
+ crosses: crossing === "max" ? "max" : undefined,
61
+ crossesAt: undefined,
62
+ }) }),
63
+ typeof value?.crossesAt === "number" ? (React.createElement(NumberField, { label: "At", ariaLabel: `${label} crosses at`, value: value.crossesAt, onChange: (crossesAt) => set({ crossesAt: crossesAt ?? 0 }) })) : null),
17
64
  React.createElement(CheckboxField, { label: "Reverse direction", ariaLabel: `${label} reverse direction`, checked: Boolean(value?.reverse), onChange: (on) => set({ reverse: on || undefined }) }),
18
65
  React.createElement(CheckboxField, { label: "Gridlines", ariaLabel: `${label} gridlines`, checked: value?.showMajorGridlines ?? gridlinesDefault, onChange: (showMajorGridlines) => set({ showMajorGridlines }) }),
66
+ kind === "value" ? (React.createElement(CheckboxField, { label: "Minor gridlines", ariaLabel: `${label} minor gridlines`, checked: Boolean(value?.showMinorGridlines), onChange: (on) => set({ showMinorGridlines: on || undefined }) })) : null,
67
+ React.createElement("div", { className: "flex flex-wrap gap-2 items-end" },
68
+ React.createElement(SelectField, { label: "Major tick marks", ariaLabel: `${label} major tick marks`, value: value?.majorTickMark ?? "out", options: TICK_MARKS, onChange: (mark) => set({ majorTickMark: mark === "out" ? undefined : mark }) }),
69
+ React.createElement(SelectField, { label: "Minor tick marks", ariaLabel: `${label} minor tick marks`, value: value?.minorTickMark ?? "none", options: TICK_MARKS, onChange: (mark) => set({ minorTickMark: mark === "none" ? undefined : mark }) })),
19
70
  React.createElement(CheckboxField, { label: "Show axis", ariaLabel: `${label} visible`, checked: value?.visible !== false, onChange: (on) => set({ visible: on ? undefined : false }) }),
20
71
  kind === "value" ? (React.createElement(TextField, { label: "Number format", ariaLabel: `${label} number format`, value: value?.numberFormatPattern, onChange: (numberFormatPattern) => set({ numberFormatPattern }), placeholder: "Linked to source" })) : null,
21
72
  React.createElement(TextFormatFields, { label: `${label} font`, collapsible: true, value: value?.textFormat, onChange: (textFormat) => set({ textFormat }) })));
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ type ElementKey = "hiLowLines" | "dropLines" | "upDownBars" | "dataTable";
3
+ /**
4
+ * Excel's Add Chart Element → Lines (High-Low, Drop), Up/Down Bars and Data
5
+ * Table (demo-app-monorepo#49969 FT-08). High-low lines and up/down bars are
6
+ * line-chart elements, drop lines line and area; every category chart can
7
+ * carry a data table.
8
+ */
9
+ export declare const ChartElementsFields: ({ chartType, spec, onChange, }: {
10
+ chartType: string;
11
+ spec: Partial<Record<ElementKey, any>>;
12
+ onChange(key: ElementKey | "dataTable.showLegendKeys", value: unknown): void;
13
+ }) => React.JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=chart-elements-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-elements-fields.d.ts","sourceRoot":"","sources":["../../../../../components/editors/fields/chart-elements-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,gCAIjC;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,0BAA0B,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9E,sBAuCA,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { CheckboxField } from "./primitives";
3
+ /**
4
+ * Excel's Add Chart Element → Lines (High-Low, Drop), Up/Down Bars and Data
5
+ * Table (demo-app-monorepo#49969 FT-08). High-low lines and up/down bars are
6
+ * line-chart elements, drop lines line and area; every category chart can
7
+ * carry a data table.
8
+ */
9
+ export const ChartElementsFields = ({ chartType, spec, onChange, }) => {
10
+ const isLine = chartType === "line";
11
+ return (React.createElement("div", { className: "flex flex-col gap-1 pb-2" },
12
+ isLine ? (React.createElement(CheckboxField, { label: "High-low lines", checked: Boolean(spec.hiLowLines), onChange: (on) => onChange("hiLowLines", on || undefined) })) : null,
13
+ isLine || chartType === "area" ? (React.createElement(CheckboxField, { label: "Drop lines", checked: Boolean(spec.dropLines), onChange: (on) => onChange("dropLines", on || undefined) })) : null,
14
+ isLine ? (React.createElement(CheckboxField, { label: "Up/down bars", checked: Boolean(spec.upDownBars), onChange: (on) => onChange("upDownBars", on ? {} : undefined) })) : null,
15
+ React.createElement(CheckboxField, { label: "Data table", checked: Boolean(spec.dataTable), onChange: (on) => onChange("dataTable", on ? {} : undefined) }),
16
+ spec.dataTable ? (React.createElement(CheckboxField, { label: "Show legend keys", checked: spec.dataTable.showLegendKeys !== false, onChange: (on) => onChange("dataTable.showLegendKeys", on ? undefined : false) })) : null));
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"series-format-fields.d.ts","sourceRoot":"","sources":["../../../../../components/editors/fields/series-format-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAqC5E;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,8CAKhC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,uBAAuB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC3C,sBAoXA,CAAC"}
1
+ {"version":3,"file":"series-format-fields.d.ts","sourceRoot":"","sources":["../../../../../components/editors/fields/series-format-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAqC5E;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,8CAKhC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,uBAAuB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC3C,sBAkZA,CAAC"}
@@ -139,5 +139,13 @@ export const SeriesFormatFields = ({ sheetId, series, capabilities, onChange, })
139
139
  },
140
140
  ],
141
141
  }) }, "Add point color")))) : null,
142
- capabilities.hasDataLabels ? (React.createElement(DataLabelsFields, { perSeries: true, value: series.dataLabels, capabilities: capabilities, onChange: (dataLabels) => onChange({ dataLabels }) })) : null));
142
+ capabilities.hasDataLabels ? (React.createElement(DataLabelsFields, { perSeries: true, value: series.dataLabels, capabilities: capabilities, onChange: (dataLabels) => onChange({ dataLabels }) })) : null,
143
+ capabilities.hasDataLabels ? (React.createElement("div", { className: "flex flex-col gap-1" },
144
+ React.createElement("label", { className: "font-system text-xs" }, "Label values from cells"),
145
+ React.createElement(ChartRangeInput, { sheetId: sheetId, range: series.dataLabels?.valueFromCells ?? undefined, onChangeRange: (valueFromCells) => onChange({
146
+ dataLabels: { ...(series.dataLabels ?? {}), show: true, valueFromCells },
147
+ }), placeholder: "Select a label range", className: "mb-0" }),
148
+ series.dataLabels?.valueFromCells ? (React.createElement("button", { type: "button", className: "font-system text-xs text-rnc-muted-foreground underline self-start", onClick: () => onChange({
149
+ dataLabels: { ...(series.dataLabels ?? {}), valueFromCells: undefined },
150
+ }) }, "Clear label range")) : null)) : null));
143
151
  };
@@ -1,5 +1,15 @@
1
1
  import type { ChartSpec } from "@rowsncolumns/spreadsheet";
2
+ import { type ThreeDRenderOptions } from "./utils/three-d";
2
3
  export declare const CHART_TYPES: Array<[string, Array<[string, Partial<ChartSpec>]>]>;
4
+ /**
5
+ * The Chart editor's preset list. With `enable3D: false` the presets the
6
+ * renderer would draw through echarts-gl (3-D Column / Bar / Line / Area,
7
+ * their stacked variants and 3-D Surface) are left out; 3-D Pie and
8
+ * Contour stay since they never render in WebGL. A spec that already
9
+ * carries a 3-D `sourceChartType` is not rewritten — only the picker
10
+ * changes (rowsncolumns/spreadsheet#1187).
11
+ */
12
+ export declare const getChartTypes: (options?: ThreeDRenderOptions) => Array<[string, Array<[string, Partial<ChartSpec>]>]>;
3
13
  /**
4
14
  * True when a spec is doughnut-shaped: the first-class
5
15
  * `chartType: "doughnut"` token, or the two legacy pie encodings —
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAwR3D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAgB1E,CAAC;AAYJ;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAQzD,CAAC;AAuBF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,MA4B9D,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAsRhF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAgB1E,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,mBAAmB,KAC5B,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAarD,CAAC;AAYF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAQzD,CAAC;AAuBF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,MA4B9D,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { DEFAULT_PIE_EXPLOSION } from "./utils/pie-explosion";
2
+ import { resolve3DRenderKind } from "./utils/three-d";
2
3
  // Excel's 3-D chart classes degrade to a 2-D chartType with the authored
3
4
  // class kept as `sourceChartType` (BAR_3D, LINE_3D, PIE_3D, AREA_3D,
4
5
  // SURFACE, SURFACE_3D). The renderer draws BAR_3D / LINE_3D / AREA_3D /
@@ -273,6 +274,25 @@ export const CHART_TYPES = [
273
274
  ["Stock", STOCK_CHART_TYPES],
274
275
  ["Combo", COMBO_CHART_TYPES],
275
276
  ];
277
+ /**
278
+ * The Chart editor's preset list. With `enable3D: false` the presets the
279
+ * renderer would draw through echarts-gl (3-D Column / Bar / Line / Area,
280
+ * their stacked variants and 3-D Surface) are left out; 3-D Pie and
281
+ * Contour stay since they never render in WebGL. A spec that already
282
+ * carries a 3-D `sourceChartType` is not rewritten — only the picker
283
+ * changes (rowsncolumns/spreadsheet#1187).
284
+ */
285
+ export const getChartTypes = (options) => {
286
+ if (options?.enable3D !== false)
287
+ return CHART_TYPES;
288
+ const groups = [];
289
+ for (const [category, presets] of CHART_TYPES) {
290
+ const kept = presets.filter(([, preset]) => resolve3DRenderKind(preset.sourceChartType) === null);
291
+ if (kept.length > 0)
292
+ groups.push([category, kept]);
293
+ }
294
+ return groups;
295
+ };
276
296
  /** Parse a radius entry ("40%" | 40 | 0) into a number, NaN-safe. */
277
297
  const parseRadiusValue = (value) => {
278
298
  if (typeof value === "number")
@@ -1 +1 @@
1
- {"root":["../../config.ts","../../echarts-gl.d.ts","../../geo-modules.d.ts","../../index.ts","../../plotly-dist.d.ts","../../types.ts","../../vitest.config.ts","../../atoms/editing-chart.atom.ts","../../atoms/pivot-chart.atom.ts","../../basic-chart/basic-chart.tsx","../../basic-chart/helpers.ts","../../basic-chart/index.tsx","../../components/dialogs/chart-editor-dialog.tsx","../../components/dialogs/pivot-chart-dialog.tsx","../../components/editors/chart-editor-capabilities.ts","../../components/editors/chart-editor.tsx","../../components/editors/chart-range-input.tsx","../../components/editors/fields/axis-options-fields.tsx","../../components/editors/fields/chart-type-options.tsx","../../components/editors/fields/data-labels-fields.tsx","../../components/editors/fields/primitives.tsx","../../components/editors/fields/series-format-fields.tsx","../../components/editors/fields/series-name-field.tsx","../../components/editors/fields/text-format-fields.tsx","../../hooks/use-chart-editor.ts","../../hooks/use-charts.ts","../../hooks/use-on-create-chart.ts","../../hooks/use-on-delete-chart.ts","../../hooks/use-on-move-chart-to-sheet.ts","../../hooks/use-on-move-chart.ts","../../hooks/use-on-resize-chart.ts","../../hooks/use-on-update-chart.ts","../../interface/create-chart.ts","../../interface/delete-chart.ts","../../interface/move-chart-to-sheet.ts","../../interface/move-chart.ts","../../interface/resize-chart.ts","../../interface/shift-chart-ranges.ts","../../interface/update-chart.ts","../../plotly/plot.ts","../../plotly/basic-chart/basic-chart.tsx","../../plotly/basic-chart/helpers.ts","../../plotly/basic-chart/index.tsx","../../utils/aggregation.ts","../../utils/axis-number-format.ts","../../utils/bar-layout.ts","../../utils/boxplot.ts","../../utils/bubble.ts","../../utils/category-levels.ts","../../utils/chart-image.ts","../../utils/chart-orientation.ts","../../utils/chart-spec-utils.ts","../../utils/chart-styles.ts","../../utils/doughnut.ts","../../utils/echarts-gl-loader.ts","../../utils/echarts-overlays.ts","../../utils/empty-cells.ts","../../utils/error-bars.ts","../../utils/gradient.ts","../../utils/hierarchy.ts","../../utils/histogram.ts","../../utils/legend-layout.ts","../../utils/of-pie.ts","../../utils/overrides.ts","../../utils/pie-explosion.ts","../../utils/plotly-click.ts","../../utils/plotly-surface.ts","../../utils/plotly-title.ts","../../utils/radar.ts","../../utils/region-map-loader.ts","../../utils/region-map.ts","../../utils/series-click.ts","../../utils/series-name.ts","../../utils/stock.ts","../../utils/three-d.ts","../../utils/trendline.ts","../../utils/waterfall.ts","../../utils/webgl.ts"],"version":"5.8.3"}
1
+ {"root":["../../config.ts","../../echarts-gl.d.ts","../../geo-modules.d.ts","../../index.ts","../../plotly-dist.d.ts","../../types.ts","../../vitest.config.ts","../../atoms/editing-chart.atom.ts","../../atoms/pivot-chart.atom.ts","../../basic-chart/basic-chart.tsx","../../basic-chart/helpers.ts","../../basic-chart/index.tsx","../../components/dialogs/chart-editor-dialog.tsx","../../components/dialogs/pivot-chart-dialog.tsx","../../components/editors/chart-editor-capabilities.ts","../../components/editors/chart-editor.tsx","../../components/editors/chart-range-input.tsx","../../components/editors/fields/axis-options-fields.tsx","../../components/editors/fields/chart-elements-fields.tsx","../../components/editors/fields/chart-type-options.tsx","../../components/editors/fields/data-labels-fields.tsx","../../components/editors/fields/primitives.tsx","../../components/editors/fields/series-format-fields.tsx","../../components/editors/fields/series-name-field.tsx","../../components/editors/fields/text-format-fields.tsx","../../hooks/use-chart-editor.ts","../../hooks/use-charts.ts","../../hooks/use-on-create-chart.ts","../../hooks/use-on-delete-chart.ts","../../hooks/use-on-move-chart-to-sheet.ts","../../hooks/use-on-move-chart.ts","../../hooks/use-on-resize-chart.ts","../../hooks/use-on-update-chart.ts","../../interface/create-chart.ts","../../interface/delete-chart.ts","../../interface/move-chart-to-sheet.ts","../../interface/move-chart.ts","../../interface/resize-chart.ts","../../interface/shift-chart-ranges.ts","../../interface/update-chart.ts","../../plotly/plot.ts","../../plotly/basic-chart/basic-chart.tsx","../../plotly/basic-chart/helpers.ts","../../plotly/basic-chart/index.tsx","../../utils/aggregation.ts","../../utils/axis-number-format.ts","../../utils/bar-layout.ts","../../utils/boxplot.ts","../../utils/bubble.ts","../../utils/category-levels.ts","../../utils/chart-image.ts","../../utils/chart-lines.ts","../../utils/chart-orientation.ts","../../utils/chart-spec-utils.ts","../../utils/chart-styles.ts","../../utils/data-table.ts","../../utils/doughnut.ts","../../utils/echarts-gl-loader.ts","../../utils/echarts-overlays.ts","../../utils/empty-cells.ts","../../utils/error-bars.ts","../../utils/excel-axis-scale.ts","../../utils/gradient.ts","../../utils/hierarchy.ts","../../utils/histogram.ts","../../utils/legend-layout.ts","../../utils/of-pie.ts","../../utils/overrides.ts","../../utils/pie-explosion.ts","../../utils/plotly-click.ts","../../utils/plotly-surface.ts","../../utils/plotly-title.ts","../../utils/radar.ts","../../utils/region-map-loader.ts","../../utils/region-map.ts","../../utils/series-click.ts","../../utils/series-name.ts","../../utils/stock.ts","../../utils/three-d.ts","../../utils/trendline.ts","../../utils/waterfall.ts","../../utils/webgl.ts"],"version":"5.8.3"}
@@ -21,6 +21,16 @@ export type EChartComponentProps = ChartComponentProps & {
21
21
  * honored.
22
22
  */
23
23
  getFormattingFromRange?: ReturnType<typeof useSpreadsheetState>["getFormattingFromRange"];
24
+ /**
25
+ * Draw BAR_3D / LINE_3D / AREA_3D / SURFACE_3D specs through echarts-gl
26
+ * (WebGL). `false` keeps them on their 2-D fallback and never loads
27
+ * echarts-gl — for a page whose Content-Security-Policy has no
28
+ * `'unsafe-eval'`, which claygl needs. The spec keeps its
29
+ * `sourceChartType`, so the xlsx export still writes the 3-D chart. Pass
30
+ * the same value to `ChartEditor` so it hides the 3-D presets. Default
31
+ * `true`.
32
+ */
33
+ enable3D?: boolean;
24
34
  /**
25
35
  * Request edit chart
26
36
  * @param chart
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,wBAAwB,EAAE,UAAU,CAClC,OAAO,mBAAmB,CAC3B,CAAC,0BAA0B,CAAC,CAAC;IAC9B;;OAEG;IACH,wBAAwB,EAAE,UAAU,CAClC,OAAO,mBAAmB,CAC3B,CAAC,0BAA0B,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,UAAU,CACjC,OAAO,mBAAmB,CAC3B,CAAC,wBAAwB,CAAC,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3C;;OAEG;IACH,kBAAkB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,oBAAoB,CAAC,CAAC;CAC7E,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IACvD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,wBAAwB,EAAE,UAAU,CAClC,OAAO,mBAAmB,CAC3B,CAAC,0BAA0B,CAAC,CAAC;IAC9B;;OAEG;IACH,wBAAwB,EAAE,UAAU,CAClC,OAAO,mBAAmB,CAC3B,CAAC,0BAA0B,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,UAAU,CACjC,OAAO,mBAAmB,CAC3B,CAAC,wBAAwB,CAAC,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3C;;OAEG;IACH,kBAAkB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,oBAAoB,CAAC,CAAC;CAC7E,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Excel's line-chart analysis elements (Chart Design → Add Chart Element →
3
+ * Lines / Up/Down Bars, demo-app-monorepo#49969 FT-08) as echarts bar series
4
+ * over the category axis:
5
+ *
6
+ * - High-low lines — a thin vertical line per category from the lowest to the
7
+ * highest value of all the line series (`<c:hiLowLines/>`).
8
+ * - Up/down bars — a bar per category from the first line series' value to
9
+ * the last one's: an up bar (white) where the last is higher, a down bar
10
+ * (dark) where it is lower (`<c:upDownBars>`).
11
+ * - Drop lines — a thin vertical line per category from the axis to the
12
+ * highest point (`<c:dropLines/>`).
13
+ *
14
+ * Each is a stack of an invisible base plus a visible span, so the bars can
15
+ * start anywhere on the value axis; `barGap: "-100%"` lays every one of them
16
+ * over the category's centre instead of side by side.
17
+ */
18
+ export declare const CHART_LINE_SERIES_PREFIX = "rnc-chart-lines-";
19
+ export type ChartLineOptions = {
20
+ hiLowLines?: boolean | null;
21
+ dropLines?: boolean | null;
22
+ upDownBars?: {
23
+ gapWidth?: number | null;
24
+ upColor?: string | null;
25
+ downColor?: string | null;
26
+ } | null;
27
+ };
28
+ /**
29
+ * The extra series for `options`, given the data of the chart's line series
30
+ * on one value axis, in spec order.
31
+ */
32
+ export declare const buildChartLineSeries: (options: ChartLineOptions, lines: ReadonlyArray<ReadonlyArray<unknown>>, { isDarkMode, yAxisIndex }?: {
33
+ isDarkMode?: boolean;
34
+ yAxisIndex?: number;
35
+ }) => Record<string, unknown>[];
36
+ //# sourceMappingURL=chart-lines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-lines.d.ts","sourceRoot":"","sources":["../../../utils/chart-lines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE;QACX,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,GAAG,IAAI,CAAC;CACV,CAAC;AAqDF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,gBAAgB,EACzB,OAAO,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAC5C,6BAA4B;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,KAC7E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAuEzB,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Excel's line-chart analysis elements (Chart Design → Add Chart Element →
3
+ * Lines / Up/Down Bars, demo-app-monorepo#49969 FT-08) as echarts bar series
4
+ * over the category axis:
5
+ *
6
+ * - High-low lines — a thin vertical line per category from the lowest to the
7
+ * highest value of all the line series (`<c:hiLowLines/>`).
8
+ * - Up/down bars — a bar per category from the first line series' value to
9
+ * the last one's: an up bar (white) where the last is higher, a down bar
10
+ * (dark) where it is lower (`<c:upDownBars>`).
11
+ * - Drop lines — a thin vertical line per category from the axis to the
12
+ * highest point (`<c:dropLines/>`).
13
+ *
14
+ * Each is a stack of an invisible base plus a visible span, so the bars can
15
+ * start anywhere on the value axis; `barGap: "-100%"` lays every one of them
16
+ * over the category's centre instead of side by side.
17
+ */
18
+ export const CHART_LINE_SERIES_PREFIX = "rnc-chart-lines-";
19
+ const finite = (item) => {
20
+ const raw = item !== null && typeof item === "object" && "value" in item
21
+ ? item.value
22
+ : item;
23
+ return typeof raw === "number" && Number.isFinite(raw) ? raw : undefined;
24
+ };
25
+ /** Excel's line colour for these elements: Text 1 at 75% (#404040). */
26
+ const LINE_COLOR = "#404040";
27
+ const spanSeries = ({ id, base, span, barWidth, itemStyle, yAxisIndex, }) => {
28
+ const common = {
29
+ type: "bar",
30
+ stack: `${CHART_LINE_SERIES_PREFIX}${id}`,
31
+ stackStrategy: "all",
32
+ barWidth,
33
+ barGap: "-100%",
34
+ silent: true,
35
+ legendHoverLink: false,
36
+ tooltip: { show: false },
37
+ emphasis: { disabled: true },
38
+ label: { show: false },
39
+ z: 1,
40
+ ...(yAxisIndex ? { yAxisIndex } : {}),
41
+ };
42
+ return [
43
+ {
44
+ ...common,
45
+ id: `${CHART_LINE_SERIES_PREFIX}${id}-base`,
46
+ data: base,
47
+ itemStyle: { color: "transparent" },
48
+ },
49
+ { ...common, id: `${CHART_LINE_SERIES_PREFIX}${id}`, data: span, itemStyle },
50
+ ];
51
+ };
52
+ /**
53
+ * The extra series for `options`, given the data of the chart's line series
54
+ * on one value axis, in spec order.
55
+ */
56
+ export const buildChartLineSeries = (options, lines, { isDarkMode, yAxisIndex } = {}) => {
57
+ const color = isDarkMode ? "rgba(255,255,255,0.65)" : LINE_COLOR;
58
+ const length = lines.reduce((n, data) => Math.max(n, data.length), 0);
59
+ const out = [];
60
+ const extent = (i) => {
61
+ const values = lines.map((data) => finite(data[i])).filter((v) => v !== undefined);
62
+ return values.length
63
+ ? { low: Math.min(...values), high: Math.max(...values), count: values.length }
64
+ : undefined;
65
+ };
66
+ if (options.dropLines && lines.length) {
67
+ const base = [];
68
+ const span = [];
69
+ for (let i = 0; i < length; i++) {
70
+ const e = extent(i);
71
+ base.push(e ? 0 : null);
72
+ span.push(e ? e.high : null);
73
+ }
74
+ out.push(...spanSeries({ id: "drop", base, span, barWidth: 1, itemStyle: { color }, yAxisIndex }));
75
+ }
76
+ if (options.hiLowLines && lines.length > 1) {
77
+ const base = [];
78
+ const span = [];
79
+ for (let i = 0; i < length; i++) {
80
+ const e = extent(i);
81
+ const drawn = e && e.count > 1;
82
+ base.push(drawn ? e.low : null);
83
+ span.push(drawn ? e.high - e.low : null);
84
+ }
85
+ out.push(...spanSeries({ id: "hilow", base, span, barWidth: 1, itemStyle: { color }, yAxisIndex }));
86
+ }
87
+ if (options.upDownBars && lines.length > 1) {
88
+ const first = lines[0];
89
+ const last = lines[lines.length - 1];
90
+ const up = options.upDownBars.upColor ?? "#FFFFFF";
91
+ const down = options.upDownBars.downColor ?? (isDarkMode ? "#A6A6A6" : "#595959");
92
+ const base = [];
93
+ const span = [];
94
+ for (let i = 0; i < length; i++) {
95
+ const open = finite(first[i]);
96
+ const close = finite(last[i]);
97
+ if (open === undefined || close === undefined) {
98
+ base.push(null);
99
+ span.push(null);
100
+ continue;
101
+ }
102
+ base.push(Math.min(open, close));
103
+ span.push({
104
+ value: Math.abs(close - open),
105
+ itemStyle: { color: close >= open ? up : down },
106
+ });
107
+ }
108
+ // `<c:gapWidth>` is the gap as a % of the bar: the bar is 1 / (1 + gap) of the category.
109
+ const gap = options.upDownBars.gapWidth ?? 150;
110
+ const barWidth = `${Math.round(100 / (1 + Math.max(0, gap) / 100))}%`;
111
+ out.push(...spanSeries({
112
+ id: "updown",
113
+ base,
114
+ span,
115
+ barWidth,
116
+ itemStyle: { borderColor: color, borderWidth: 1 },
117
+ yAxisIndex,
118
+ }));
119
+ }
120
+ return out;
121
+ };
@@ -0,0 +1,31 @@
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
+ export type DataTableOptions = {
10
+ showHorizontalBorder?: boolean | null;
11
+ showVerticalBorder?: boolean | null;
12
+ showOutline?: boolean | null;
13
+ showLegendKeys?: boolean | null;
14
+ };
15
+ export type DataTableRow = {
16
+ name: string;
17
+ color?: string;
18
+ values: string[];
19
+ };
20
+ /** Row height in pixels: 9 pt text plus padding. */
21
+ export declare const DATA_TABLE_ROW_HEIGHT = 20;
22
+ export declare const dataTableAxes: (rows: ReadonlyArray<DataTableRow>, options: DataTableOptions, { textColor, fontSize, borderColor, firstOffset, }: {
23
+ textColor: string;
24
+ fontSize: number;
25
+ borderColor?: string;
26
+ /** Below the category labels (the table's header row). */
27
+ firstOffset?: number;
28
+ }) => Record<string, unknown>[];
29
+ /** Room the row names need left of the plot (approximate glyph width). */
30
+ export declare const dataTableNameWidth: (rows: ReadonlyArray<DataTableRow>, fontSize: number, legendKeys: boolean) => number;
31
+ //# sourceMappingURL=data-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../utils/data-table.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,aAAa,GACxB,MAAM,aAAa,CAAC,YAAY,CAAC,EACjC,SAAS,gBAAgB,EACzB,oDAKG;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,KACA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAqCtB,CAAC;AAEL,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,GAC7B,MAAM,aAAa,CAAC,YAAY,CAAC,EACjC,UAAU,MAAM,EAChB,YAAY,OAAO,WAQb,CAAC"}