@opendata-ai/openchart-engine 7.5.0 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/compile-layer.test.ts +94 -0
- package/src/charts/scatter/__tests__/compute.test.ts +24 -0
- package/src/charts/scatter/index.ts +10 -5
- package/src/compile/layer.ts +11 -1
- package/src/compile.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -7523,9 +7523,11 @@ function computeTrendLine(marks) {
|
|
|
7523
7523
|
var scatterRenderer = (spec, scales, chartArea, strategy, _theme) => {
|
|
7524
7524
|
const pointMarks = computeScatterMarks(spec, scales, chartArea, strategy);
|
|
7525
7525
|
const marks = [...pointMarks];
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7526
|
+
if (spec.markDef?.trendline !== false) {
|
|
7527
|
+
const trendLine = computeTrendLine(pointMarks);
|
|
7528
|
+
if (trendLine) {
|
|
7529
|
+
marks.unshift(trendLine);
|
|
7530
|
+
}
|
|
7529
7531
|
}
|
|
7530
7532
|
return marks;
|
|
7531
7533
|
};
|
|
@@ -10974,8 +10976,14 @@ function compileLayer(spec, options, compileChart2) {
|
|
|
10974
10976
|
zIndex: leaf.zIndex ?? i
|
|
10975
10977
|
}));
|
|
10976
10978
|
indexedLeaves.sort((a, b) => a.zIndex - b.zIndex);
|
|
10979
|
+
const leafOptions = { ...options, frozenChartArea: primaryLayout.area };
|
|
10977
10980
|
for (const { leaf } of indexedLeaves) {
|
|
10978
|
-
const
|
|
10981
|
+
const themedLeaf = {
|
|
10982
|
+
...leaf,
|
|
10983
|
+
theme: leaf.theme ?? spec.theme,
|
|
10984
|
+
darkMode: leaf.darkMode ?? spec.darkMode
|
|
10985
|
+
};
|
|
10986
|
+
const leafLayout = compileChart2(themedLeaf, leafOptions);
|
|
10979
10987
|
allMarks.push(...leafLayout.marks);
|
|
10980
10988
|
const leafLeg = leafLayout.legend;
|
|
10981
10989
|
if ("entries" in leafLeg) {
|
|
@@ -15562,7 +15570,7 @@ function compileChart(spec, options) {
|
|
|
15562
15570
|
plan.xAxisExtent
|
|
15563
15571
|
);
|
|
15564
15572
|
const dims = computeDimensions(chartSpec, options, legendStub, theme, strategy, watermark, plan);
|
|
15565
|
-
const chartArea = dims.chartArea;
|
|
15573
|
+
const chartArea = options.frozenChartArea ?? dims.chartArea;
|
|
15566
15574
|
const finalLegend = placeLegend(
|
|
15567
15575
|
plan.legendContent,
|
|
15568
15576
|
chartArea,
|