@rowsncolumns/charts 28.1.14 → 28.1.16
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/cjs/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/basic-chart/basic-chart.js +312 -271
- package/dist/cjs/components/editors/chart-editor-capabilities.d.ts +48 -0
- package/dist/cjs/components/editors/chart-editor-capabilities.d.ts.map +1 -0
- package/dist/cjs/components/editors/chart-editor-capabilities.js +62 -0
- package/dist/cjs/components/editors/chart-editor.d.ts.map +1 -1
- package/dist/cjs/components/editors/chart-editor.js +200 -534
- package/dist/cjs/components/editors/fields/axis-options-fields.d.ts +16 -0
- package/dist/cjs/components/editors/fields/axis-options-fields.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/axis-options-fields.js +31 -0
- package/dist/cjs/components/editors/fields/chart-type-options.d.ts +25 -0
- package/dist/cjs/components/editors/fields/chart-type-options.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/chart-type-options.js +170 -0
- package/dist/cjs/components/editors/fields/data-labels-fields.d.ts +15 -0
- package/dist/cjs/components/editors/fields/data-labels-fields.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/data-labels-fields.js +57 -0
- package/dist/cjs/components/editors/fields/primitives.d.ts +54 -0
- package/dist/cjs/components/editors/fields/primitives.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/primitives.js +52 -0
- package/dist/cjs/components/editors/fields/series-format-fields.d.ts +17 -0
- package/dist/cjs/components/editors/fields/series-format-fields.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/series-format-fields.js +165 -0
- package/dist/cjs/components/editors/fields/series-name-field.d.ts +16 -0
- package/dist/cjs/components/editors/fields/series-name-field.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/series-name-field.js +36 -0
- package/dist/cjs/components/editors/fields/text-format-fields.d.ts +20 -0
- package/dist/cjs/components/editors/fields/text-format-fields.d.ts.map +1 -0
- package/dist/cjs/components/editors/fields/text-format-fields.js +46 -0
- package/dist/cjs/config.d.ts.map +1 -1
- package/dist/cjs/config.js +3 -0
- package/dist/cjs/interface/create-chart.d.ts +3 -2
- package/dist/cjs/interface/create-chart.d.ts.map +1 -1
- package/dist/cjs/interface/create-chart.js +7 -0
- package/dist/cjs/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/plotly/basic-chart/basic-chart.js +255 -218
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/chart-orientation.d.ts.map +1 -1
- package/dist/cjs/utils/chart-orientation.js +24 -12
- package/dist/cjs/utils/chart-spec-utils.d.ts.map +1 -1
- package/dist/cjs/utils/chart-spec-utils.js +120 -21
- package/dist/cjs/utils/echarts-overlays.d.ts +2 -0
- package/dist/cjs/utils/echarts-overlays.d.ts.map +1 -1
- package/dist/cjs/utils/echarts-overlays.js +25 -12
- package/dist/cjs/utils/series-name.d.ts +12 -0
- package/dist/cjs/utils/series-name.d.ts.map +1 -0
- package/dist/cjs/utils/series-name.js +26 -0
- package/dist/cjs/utils/trendline.d.ts +9 -0
- package/dist/cjs/utils/trendline.d.ts.map +1 -1
- package/dist/cjs/utils/trendline.js +16 -1
- package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/basic-chart/basic-chart.js +80 -38
- package/dist/esm/components/editors/chart-editor-capabilities.d.ts +48 -0
- package/dist/esm/components/editors/chart-editor-capabilities.d.ts.map +1 -0
- package/dist/esm/components/editors/chart-editor-capabilities.js +58 -0
- package/dist/esm/components/editors/chart-editor.d.ts.map +1 -1
- package/dist/esm/components/editors/chart-editor.js +166 -448
- package/dist/esm/components/editors/fields/axis-options-fields.d.ts +16 -0
- package/dist/esm/components/editors/fields/axis-options-fields.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/axis-options-fields.js +22 -0
- package/dist/esm/components/editors/fields/chart-type-options.d.ts +25 -0
- package/dist/esm/components/editors/fields/chart-type-options.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/chart-type-options.js +151 -0
- package/dist/esm/components/editors/fields/data-labels-fields.d.ts +15 -0
- package/dist/esm/components/editors/fields/data-labels-fields.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/data-labels-fields.js +47 -0
- package/dist/esm/components/editors/fields/primitives.d.ts +54 -0
- package/dist/esm/components/editors/fields/primitives.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/primitives.js +26 -0
- package/dist/esm/components/editors/fields/series-format-fields.d.ts +17 -0
- package/dist/esm/components/editors/fields/series-format-fields.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/series-format-fields.js +143 -0
- package/dist/esm/components/editors/fields/series-name-field.d.ts +16 -0
- package/dist/esm/components/editors/fields/series-name-field.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/series-name-field.js +31 -0
- package/dist/esm/components/editors/fields/text-format-fields.d.ts +20 -0
- package/dist/esm/components/editors/fields/text-format-fields.d.ts.map +1 -0
- package/dist/esm/components/editors/fields/text-format-fields.js +34 -0
- package/dist/esm/config.d.ts.map +1 -1
- package/dist/esm/config.js +3 -0
- package/dist/esm/interface/create-chart.d.ts +3 -2
- package/dist/esm/interface/create-chart.d.ts.map +1 -1
- package/dist/esm/interface/create-chart.js +8 -1
- package/dist/esm/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/plotly/basic-chart/basic-chart.js +52 -30
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/utils/chart-orientation.d.ts.map +1 -1
- package/dist/esm/utils/chart-orientation.js +20 -0
- package/dist/esm/utils/chart-spec-utils.d.ts.map +1 -1
- package/dist/esm/utils/chart-spec-utils.js +95 -8
- package/dist/esm/utils/echarts-overlays.d.ts +2 -0
- package/dist/esm/utils/echarts-overlays.d.ts.map +1 -1
- package/dist/esm/utils/echarts-overlays.js +15 -1
- package/dist/esm/utils/series-name.d.ts +12 -0
- package/dist/esm/utils/series-name.d.ts.map +1 -0
- package/dist/esm/utils/series-name.js +24 -0
- package/dist/esm/utils/trendline.d.ts +9 -0
- package/dist/esm/utils/trendline.d.ts.map +1 -1
- package/dist/esm/utils/trendline.js +14 -0
- package/package.json +3 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { EmbeddedChart } from "@rowsncolumns/spreadsheet";
|
|
2
|
+
type ChartSpec = EmbeddedChart["spec"];
|
|
3
|
+
/**
|
|
4
|
+
* Which editor controls a chart type gets — Excel's rule set, so an option
|
|
5
|
+
* is only offered where the chart (and the renderers) honour it
|
|
6
|
+
* (rowsncolumns/spreadsheet#1102): a funnel has no axes, a box & whisker
|
|
7
|
+
* no trendlines, a pie no gap width.
|
|
8
|
+
*/
|
|
9
|
+
export type ChartEditorCapabilities = {
|
|
10
|
+
category: "basic" | "bubble" | "hierarchy";
|
|
11
|
+
/** Value axis scale / gridlines / number format / visibility / font. */
|
|
12
|
+
hasValueAxis: boolean;
|
|
13
|
+
/** Category axis gridlines / direction / visibility / font. */
|
|
14
|
+
hasCategoryAxis: boolean;
|
|
15
|
+
/** The second value axis a series can opt into. */
|
|
16
|
+
hasSecondaryAxis: boolean;
|
|
17
|
+
/** Vertical / horizontal axis titles. */
|
|
18
|
+
hasAxisTitles: boolean;
|
|
19
|
+
hasTrendlines: boolean;
|
|
20
|
+
hasErrorBars: boolean;
|
|
21
|
+
/** Gap between category clusters (bars, columns, bins, boxes, waterfall steps). */
|
|
22
|
+
hasGapWidth: boolean;
|
|
23
|
+
/** Overlap of the bars of one category. */
|
|
24
|
+
hasOverlap: boolean;
|
|
25
|
+
/** "Invert if negative" + the negative fill. */
|
|
26
|
+
hasInvertIfNegative: boolean;
|
|
27
|
+
/** Per-series marker shape and size. */
|
|
28
|
+
hasMarkers: boolean;
|
|
29
|
+
hasLegend: boolean;
|
|
30
|
+
hasDataLabels: boolean;
|
|
31
|
+
/** Pie / doughnut "percentage" label. */
|
|
32
|
+
hasPercentLabels: boolean;
|
|
33
|
+
/** Bubble "bubble size" label. */
|
|
34
|
+
hasBubbleSizeLabels: boolean;
|
|
35
|
+
/** Per-series fill options: colour, gradient, no fill, point colours. */
|
|
36
|
+
hasSeriesFill: boolean;
|
|
37
|
+
/** Per-point colours (Format Data Point → Fill). */
|
|
38
|
+
hasPointColors: boolean;
|
|
39
|
+
/** Per-series chart type (combo). */
|
|
40
|
+
hasSeriesChartType: boolean;
|
|
41
|
+
/** Multi-level category axis (several label columns). */
|
|
42
|
+
hasCategoryLevels: boolean;
|
|
43
|
+
/** Empty-cell / #N/A handling (cell-driven series). */
|
|
44
|
+
hasEmptyCellOptions: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const getChartEditorCapabilities: (spec: Pick<ChartSpec, "chartType">) => ChartEditorCapabilities;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=chart-editor-capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-editor-capabilities.d.ts","sourceRoot":"","sources":["../../../../components/editors/chart-editor-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,KAAK,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAGvC;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC3C,wEAAwE;IACxE,YAAY,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,eAAe,EAAE,OAAO,CAAC;IACzB,mDAAmD;IACnD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yCAAyC;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,mFAAmF;IACnF,WAAW,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kCAAkC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,aAAa,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,cAAc,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uDAAuD;IACvD,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AA6BF,eAAO,MAAM,0BAA0B,GACrC,MAAM,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,KACjC,uBAmCF,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChartEditorCapabilities = void 0;
|
|
4
|
+
var chart_spec_utils_1 = require("../../utils/chart-spec-utils");
|
|
5
|
+
var CARTESIAN = new Set([
|
|
6
|
+
"bar",
|
|
7
|
+
"column",
|
|
8
|
+
"line",
|
|
9
|
+
"area",
|
|
10
|
+
"combo",
|
|
11
|
+
"stock",
|
|
12
|
+
"histogram",
|
|
13
|
+
"boxplot",
|
|
14
|
+
"waterfall",
|
|
15
|
+
"scatter",
|
|
16
|
+
"bubble",
|
|
17
|
+
]);
|
|
18
|
+
/** Excel offers trendlines and error bars on the unstacked XY-ish families only. */
|
|
19
|
+
var FITTABLE = new Set([
|
|
20
|
+
"bar",
|
|
21
|
+
"column",
|
|
22
|
+
"line",
|
|
23
|
+
"area",
|
|
24
|
+
"combo",
|
|
25
|
+
"scatter",
|
|
26
|
+
"bubble",
|
|
27
|
+
]);
|
|
28
|
+
var BARS = new Set(["bar", "column", "combo"]);
|
|
29
|
+
var getChartEditorCapabilities = function (spec) {
|
|
30
|
+
var type = spec.chartType;
|
|
31
|
+
var category = (0, chart_spec_utils_1.getChartCategory)(type);
|
|
32
|
+
var cartesian = CARTESIAN.has(type);
|
|
33
|
+
var fittable = FITTABLE.has(type);
|
|
34
|
+
var circular = type === "pie" || type === "doughnut";
|
|
35
|
+
var hierarchy = category === "hierarchy";
|
|
36
|
+
return {
|
|
37
|
+
category: category,
|
|
38
|
+
hasValueAxis: cartesian || type === "radar",
|
|
39
|
+
hasCategoryAxis: cartesian,
|
|
40
|
+
hasSecondaryAxis: fittable,
|
|
41
|
+
hasAxisTitles: cartesian,
|
|
42
|
+
hasTrendlines: fittable,
|
|
43
|
+
hasErrorBars: fittable,
|
|
44
|
+
hasGapWidth: BARS.has(type) ||
|
|
45
|
+
type === "histogram" ||
|
|
46
|
+
type === "boxplot" ||
|
|
47
|
+
type === "waterfall",
|
|
48
|
+
hasOverlap: BARS.has(type),
|
|
49
|
+
hasInvertIfNegative: BARS.has(type),
|
|
50
|
+
hasMarkers: type === "line" || type === "scatter" || type === "radar",
|
|
51
|
+
hasLegend: true,
|
|
52
|
+
hasDataLabels: type !== "regionMap",
|
|
53
|
+
hasPercentLabels: circular,
|
|
54
|
+
hasBubbleSizeLabels: type === "bubble",
|
|
55
|
+
hasSeriesFill: type !== "regionMap" && type !== "stock",
|
|
56
|
+
hasPointColors: !hierarchy && type !== "regionMap" && type !== "stock" && type !== "radar",
|
|
57
|
+
hasSeriesChartType: type === "combo",
|
|
58
|
+
hasCategoryLevels: BARS.has(type) || type === "line" || type === "area" || type === "stock",
|
|
59
|
+
hasEmptyCellOptions: category === "basic",
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
exports.getChartEditorCapabilities = getChartEditorCapabilities;
|
|
@@ -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;
|
|
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"}
|