@odoo/o-spreadsheet 17.4.9 → 17.4.10
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/o-spreadsheet.cjs.js +120 -79
- package/dist/o-spreadsheet.esm.js +120 -79
- package/dist/o-spreadsheet.iife.js +120 -79
- package/dist/o-spreadsheet.iife.min.js +345 -345
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2024-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.10
|
|
6
|
+
* @date 2024-10-24T08:54:56.262Z
|
|
7
|
+
* @hash c82d9c1
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -10625,67 +10625,108 @@ const chartShowValuesPlugin = {
|
|
|
10625
10625
|
ctx.save();
|
|
10626
10626
|
ctx.textAlign = "center";
|
|
10627
10627
|
ctx.textBaseline = "middle";
|
|
10628
|
-
ctx.
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
ctx.fillStyle = chartFontColor(bar.options.backgroundColor);
|
|
10642
|
-
ctx.strokeStyle = chartFontColor(ctx.fillStyle);
|
|
10643
|
-
const value = options.callback(dataset._parsed[i]);
|
|
10644
|
-
ctx.strokeText(value, x, y);
|
|
10645
|
-
ctx.fillText(value, x, y);
|
|
10646
|
-
}
|
|
10647
|
-
break;
|
|
10648
|
-
}
|
|
10649
|
-
case "bar":
|
|
10650
|
-
case "line": {
|
|
10651
|
-
const yOffset = dataset.type === "bar" && !options.horizontal ? 0 : 3;
|
|
10652
|
-
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10653
|
-
const point = dataset.data[i];
|
|
10654
|
-
const value = options.horizontal ? dataset._parsed[i].x : dataset._parsed[i].y;
|
|
10655
|
-
const displayedValue = options.callback(value - 0);
|
|
10656
|
-
let xPosition = 0, yPosition = 0;
|
|
10657
|
-
if (options.horizontal) {
|
|
10658
|
-
yPosition = point.y;
|
|
10659
|
-
if (value < 0) {
|
|
10660
|
-
ctx.textAlign = "right";
|
|
10661
|
-
xPosition = point.x - yOffset;
|
|
10662
|
-
}
|
|
10663
|
-
else {
|
|
10664
|
-
ctx.textAlign = "left";
|
|
10665
|
-
xPosition = point.x + yOffset;
|
|
10666
|
-
}
|
|
10667
|
-
}
|
|
10668
|
-
else {
|
|
10669
|
-
xPosition = point.x;
|
|
10670
|
-
if (value < 0) {
|
|
10671
|
-
ctx.textBaseline = "top";
|
|
10672
|
-
yPosition = point.y + yOffset;
|
|
10673
|
-
}
|
|
10674
|
-
else {
|
|
10675
|
-
ctx.textBaseline = "bottom";
|
|
10676
|
-
yPosition = point.y - yOffset;
|
|
10677
|
-
}
|
|
10678
|
-
}
|
|
10679
|
-
ctx.strokeText(displayedValue, xPosition, yPosition);
|
|
10680
|
-
ctx.fillText(displayedValue, xPosition, yPosition);
|
|
10681
|
-
}
|
|
10682
|
-
break;
|
|
10683
|
-
}
|
|
10684
|
-
}
|
|
10685
|
-
});
|
|
10628
|
+
ctx.miterLimit = 1; // Avoid sharp artifacts on strokeText
|
|
10629
|
+
switch (chart.config.type) {
|
|
10630
|
+
case "pie":
|
|
10631
|
+
case "doughnut":
|
|
10632
|
+
drawPieChartValues(chart, options, ctx);
|
|
10633
|
+
break;
|
|
10634
|
+
case "bar":
|
|
10635
|
+
case "line":
|
|
10636
|
+
options.horizontal
|
|
10637
|
+
? drawHorizontalBarChartValues(chart, options, ctx)
|
|
10638
|
+
: drawLineOrBarChartValues(chart, options, ctx);
|
|
10639
|
+
break;
|
|
10640
|
+
}
|
|
10686
10641
|
ctx.restore();
|
|
10687
10642
|
},
|
|
10688
10643
|
};
|
|
10644
|
+
function drawTextWithBackground(text, x, y, ctx) {
|
|
10645
|
+
ctx.lineWidth = 3; // Stroke the text with a big lineWidth width to have some kind of background
|
|
10646
|
+
ctx.strokeText(text, x, y);
|
|
10647
|
+
ctx.lineWidth = 1;
|
|
10648
|
+
ctx.fillText(text, x, y);
|
|
10649
|
+
}
|
|
10650
|
+
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
10651
|
+
const yMax = chart.chartArea.bottom;
|
|
10652
|
+
const yMin = chart.chartArea.top;
|
|
10653
|
+
const textsPositions = {};
|
|
10654
|
+
for (const dataset of chart._metasets) {
|
|
10655
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10656
|
+
const value = dataset._parsed[i].y;
|
|
10657
|
+
const point = dataset.data[i];
|
|
10658
|
+
const xPosition = point.x;
|
|
10659
|
+
let yPosition = 0;
|
|
10660
|
+
if (chart.config.type === "line") {
|
|
10661
|
+
yPosition = point.y - 10;
|
|
10662
|
+
}
|
|
10663
|
+
else {
|
|
10664
|
+
yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
|
|
10665
|
+
}
|
|
10666
|
+
yPosition = Math.min(yPosition, yMax);
|
|
10667
|
+
yPosition = Math.max(yPosition, yMin);
|
|
10668
|
+
// Avoid overlapping texts with same X
|
|
10669
|
+
if (!textsPositions[xPosition]) {
|
|
10670
|
+
textsPositions[xPosition] = [];
|
|
10671
|
+
}
|
|
10672
|
+
for (const otherPosition of textsPositions[xPosition] || []) {
|
|
10673
|
+
if (Math.abs(otherPosition - yPosition) < 13) {
|
|
10674
|
+
yPosition = otherPosition - 13;
|
|
10675
|
+
}
|
|
10676
|
+
}
|
|
10677
|
+
textsPositions[xPosition].push(yPosition);
|
|
10678
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
10679
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10680
|
+
drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
|
|
10681
|
+
}
|
|
10682
|
+
}
|
|
10683
|
+
}
|
|
10684
|
+
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
10685
|
+
const xMax = chart.chartArea.right;
|
|
10686
|
+
const xMin = chart.chartArea.left;
|
|
10687
|
+
const textsPositions = {};
|
|
10688
|
+
for (const dataset of chart._metasets) {
|
|
10689
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10690
|
+
const value = dataset._parsed[i].x;
|
|
10691
|
+
const displayValue = options.callback(value - 0);
|
|
10692
|
+
const point = dataset.data[i];
|
|
10693
|
+
const yPosition = point.y;
|
|
10694
|
+
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
10695
|
+
xPosition = Math.min(xPosition, xMax);
|
|
10696
|
+
xPosition = Math.max(xPosition, xMin);
|
|
10697
|
+
// Avoid overlapping texts with same Y
|
|
10698
|
+
if (!textsPositions[yPosition]) {
|
|
10699
|
+
textsPositions[yPosition] = [];
|
|
10700
|
+
}
|
|
10701
|
+
const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
|
|
10702
|
+
for (const otherPosition of textsPositions[yPosition]) {
|
|
10703
|
+
if (Math.abs(otherPosition - xPosition) < textWidth) {
|
|
10704
|
+
xPosition = otherPosition + textWidth + 3;
|
|
10705
|
+
}
|
|
10706
|
+
}
|
|
10707
|
+
textsPositions[yPosition].push(xPosition);
|
|
10708
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
10709
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10710
|
+
drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
|
|
10711
|
+
}
|
|
10712
|
+
}
|
|
10713
|
+
}
|
|
10714
|
+
function drawPieChartValues(chart, options, ctx) {
|
|
10715
|
+
for (const dataset of chart._metasets) {
|
|
10716
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10717
|
+
const bar = dataset.data[i];
|
|
10718
|
+
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
10719
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
10720
|
+
const midRadius = (innerRadius + outerRadius) / 2;
|
|
10721
|
+
const x = bar.x + midRadius * Math.cos(midAngle);
|
|
10722
|
+
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10723
|
+
ctx.fillStyle = chartFontColor(options.background);
|
|
10724
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10725
|
+
const value = options.callback(dataset._parsed[i]);
|
|
10726
|
+
drawTextWithBackground(value, x, y, ctx);
|
|
10727
|
+
}
|
|
10728
|
+
}
|
|
10729
|
+
}
|
|
10689
10730
|
|
|
10690
10731
|
/** This is a chartJS plugin that will draw connector lines between the bars of a Waterfall chart */
|
|
10691
10732
|
const waterfallLinesPlugin = {
|
|
@@ -23415,7 +23456,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
23415
23456
|
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
23416
23457
|
// tooltipItem.parsed can be an object or a number for pie charts
|
|
23417
23458
|
let yLabel = horizontalChart ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
23418
|
-
if (
|
|
23459
|
+
if (yLabel === undefined || yLabel === null) {
|
|
23419
23460
|
yLabel = tooltipItem.parsed;
|
|
23420
23461
|
}
|
|
23421
23462
|
const toolTipFormat = !format && Math.abs(yLabel) >= 1000 ? "#,##" : format;
|
|
@@ -46532,7 +46573,7 @@ function load(data, verboseImport) {
|
|
|
46532
46573
|
if (!data) {
|
|
46533
46574
|
return createEmptyWorkbookData();
|
|
46534
46575
|
}
|
|
46535
|
-
console.
|
|
46576
|
+
console.debug("### Loading data ###");
|
|
46536
46577
|
const start = performance.now();
|
|
46537
46578
|
if (data["[Content_Types].xml"]) {
|
|
46538
46579
|
const reader = new XlsxReader(data);
|
|
@@ -46546,13 +46587,13 @@ function load(data, verboseImport) {
|
|
|
46546
46587
|
// apply migrations, if needed
|
|
46547
46588
|
if ("version" in data) {
|
|
46548
46589
|
if (data.version < CURRENT_VERSION) {
|
|
46549
|
-
console.
|
|
46590
|
+
console.debug("Migrating data from version", data.version);
|
|
46550
46591
|
data = migrate(data);
|
|
46551
46592
|
}
|
|
46552
46593
|
}
|
|
46553
46594
|
data = repairData(data);
|
|
46554
|
-
console.
|
|
46555
|
-
console.
|
|
46595
|
+
console.debug("Data loaded in", performance.now() - start, "ms");
|
|
46596
|
+
console.debug("###");
|
|
46556
46597
|
return data;
|
|
46557
46598
|
}
|
|
46558
46599
|
function migrate(data) {
|
|
@@ -46561,7 +46602,7 @@ function migrate(data) {
|
|
|
46561
46602
|
for (let i = index; i < MIGRATIONS.length; i++) {
|
|
46562
46603
|
data = MIGRATIONS[i].applyMigration(data);
|
|
46563
46604
|
}
|
|
46564
|
-
console.
|
|
46605
|
+
console.debug("Data migrated in", performance.now() - start, "ms");
|
|
46565
46606
|
return data;
|
|
46566
46607
|
}
|
|
46567
46608
|
const MIGRATIONS = [
|
|
@@ -54121,7 +54162,7 @@ class Evaluator {
|
|
|
54121
54162
|
cellsToCompute.addMany(arrayFormulasPositions);
|
|
54122
54163
|
cellsToCompute.addMany(this.getCellsDependingOn(arrayFormulasPositions));
|
|
54123
54164
|
this.evaluate(cellsToCompute);
|
|
54124
|
-
console.
|
|
54165
|
+
console.debug("evaluate Cells", performance.now() - start, "ms");
|
|
54125
54166
|
}
|
|
54126
54167
|
getArrayFormulasImpactedByChangesOf(positions) {
|
|
54127
54168
|
const impactedPositions = this.createEmptyPositionSet();
|
|
@@ -54160,7 +54201,7 @@ class Evaluator {
|
|
|
54160
54201
|
const start = performance.now();
|
|
54161
54202
|
this.evaluatedCells = new PositionMap();
|
|
54162
54203
|
this.evaluate(this.getAllCells());
|
|
54163
|
-
console.
|
|
54204
|
+
console.debug("evaluate all cells", performance.now() - start, "ms");
|
|
54164
54205
|
}
|
|
54165
54206
|
evaluateFormulaResult(sheetId, formulaString) {
|
|
54166
54207
|
try {
|
|
@@ -57310,7 +57351,7 @@ class Session extends EventBus {
|
|
|
57310
57351
|
this.onMessageReceived(message);
|
|
57311
57352
|
}
|
|
57312
57353
|
this.isReplayingInitialRevisions = false;
|
|
57313
|
-
console.
|
|
57354
|
+
console.debug("Replayed", numberOfCommands, "commands in", performance.now() - start, "ms");
|
|
57314
57355
|
}
|
|
57315
57356
|
/**
|
|
57316
57357
|
* Notify the server that the user client left the collaborative session
|
|
@@ -67920,7 +67961,7 @@ class Model extends EventBus {
|
|
|
67920
67961
|
coreHandlers = [];
|
|
67921
67962
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
67922
67963
|
const start = performance.now();
|
|
67923
|
-
console.
|
|
67964
|
+
console.debug("##### Model creation #####");
|
|
67924
67965
|
super();
|
|
67925
67966
|
setDefaultTranslationMethod();
|
|
67926
67967
|
stateUpdateMessages = repairInitialMessages(data, stateUpdateMessages);
|
|
@@ -67992,16 +68033,16 @@ class Model extends EventBus {
|
|
|
67992
68033
|
this.joinSession();
|
|
67993
68034
|
if (config.snapshotRequested) {
|
|
67994
68035
|
const startSnapshot = performance.now();
|
|
67995
|
-
console.
|
|
68036
|
+
console.debug("Snapshot requested");
|
|
67996
68037
|
this.session.snapshot(this.exportData());
|
|
67997
68038
|
this.garbageCollectExternalResources();
|
|
67998
|
-
console.
|
|
68039
|
+
console.debug("Snapshot taken in", performance.now() - startSnapshot, "ms");
|
|
67999
68040
|
}
|
|
68000
68041
|
// mark all models as "raw", so they will not be turned into reactive objects
|
|
68001
68042
|
// by owl, since we do not rely on reactivity
|
|
68002
68043
|
owl.markRaw(this);
|
|
68003
|
-
console.
|
|
68004
|
-
console.
|
|
68044
|
+
console.debug("Model created in", performance.now() - start, "ms");
|
|
68045
|
+
console.debug("######");
|
|
68005
68046
|
}
|
|
68006
68047
|
joinSession() {
|
|
68007
68048
|
this.session.join(this.config.client);
|
|
@@ -68224,7 +68265,7 @@ class Model extends EventBus {
|
|
|
68224
68265
|
this.finalize();
|
|
68225
68266
|
const time = performance.now() - start;
|
|
68226
68267
|
if (time > 5) {
|
|
68227
|
-
console.
|
|
68268
|
+
console.debug(type, time, "ms");
|
|
68228
68269
|
}
|
|
68229
68270
|
});
|
|
68230
68271
|
this.session.save(command, commands, changes);
|
|
@@ -68610,6 +68651,6 @@ exports.tokenColors = tokenColors;
|
|
|
68610
68651
|
exports.tokenize = tokenize;
|
|
68611
68652
|
|
|
68612
68653
|
|
|
68613
|
-
__info__.version = "17.4.
|
|
68614
|
-
__info__.date = "2024-10-
|
|
68615
|
-
__info__.hash = "
|
|
68654
|
+
__info__.version = "17.4.10";
|
|
68655
|
+
__info__.date = "2024-10-24T08:54:56.262Z";
|
|
68656
|
+
__info__.hash = "c82d9c1";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 17.4.
|
|
6
|
-
* @date 2024-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.10
|
|
6
|
+
* @date 2024-10-24T08:54:56.262Z
|
|
7
|
+
* @hash c82d9c1
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -10623,67 +10623,108 @@ const chartShowValuesPlugin = {
|
|
|
10623
10623
|
ctx.save();
|
|
10624
10624
|
ctx.textAlign = "center";
|
|
10625
10625
|
ctx.textBaseline = "middle";
|
|
10626
|
-
ctx.
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
ctx.fillStyle = chartFontColor(bar.options.backgroundColor);
|
|
10640
|
-
ctx.strokeStyle = chartFontColor(ctx.fillStyle);
|
|
10641
|
-
const value = options.callback(dataset._parsed[i]);
|
|
10642
|
-
ctx.strokeText(value, x, y);
|
|
10643
|
-
ctx.fillText(value, x, y);
|
|
10644
|
-
}
|
|
10645
|
-
break;
|
|
10646
|
-
}
|
|
10647
|
-
case "bar":
|
|
10648
|
-
case "line": {
|
|
10649
|
-
const yOffset = dataset.type === "bar" && !options.horizontal ? 0 : 3;
|
|
10650
|
-
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10651
|
-
const point = dataset.data[i];
|
|
10652
|
-
const value = options.horizontal ? dataset._parsed[i].x : dataset._parsed[i].y;
|
|
10653
|
-
const displayedValue = options.callback(value - 0);
|
|
10654
|
-
let xPosition = 0, yPosition = 0;
|
|
10655
|
-
if (options.horizontal) {
|
|
10656
|
-
yPosition = point.y;
|
|
10657
|
-
if (value < 0) {
|
|
10658
|
-
ctx.textAlign = "right";
|
|
10659
|
-
xPosition = point.x - yOffset;
|
|
10660
|
-
}
|
|
10661
|
-
else {
|
|
10662
|
-
ctx.textAlign = "left";
|
|
10663
|
-
xPosition = point.x + yOffset;
|
|
10664
|
-
}
|
|
10665
|
-
}
|
|
10666
|
-
else {
|
|
10667
|
-
xPosition = point.x;
|
|
10668
|
-
if (value < 0) {
|
|
10669
|
-
ctx.textBaseline = "top";
|
|
10670
|
-
yPosition = point.y + yOffset;
|
|
10671
|
-
}
|
|
10672
|
-
else {
|
|
10673
|
-
ctx.textBaseline = "bottom";
|
|
10674
|
-
yPosition = point.y - yOffset;
|
|
10675
|
-
}
|
|
10676
|
-
}
|
|
10677
|
-
ctx.strokeText(displayedValue, xPosition, yPosition);
|
|
10678
|
-
ctx.fillText(displayedValue, xPosition, yPosition);
|
|
10679
|
-
}
|
|
10680
|
-
break;
|
|
10681
|
-
}
|
|
10682
|
-
}
|
|
10683
|
-
});
|
|
10626
|
+
ctx.miterLimit = 1; // Avoid sharp artifacts on strokeText
|
|
10627
|
+
switch (chart.config.type) {
|
|
10628
|
+
case "pie":
|
|
10629
|
+
case "doughnut":
|
|
10630
|
+
drawPieChartValues(chart, options, ctx);
|
|
10631
|
+
break;
|
|
10632
|
+
case "bar":
|
|
10633
|
+
case "line":
|
|
10634
|
+
options.horizontal
|
|
10635
|
+
? drawHorizontalBarChartValues(chart, options, ctx)
|
|
10636
|
+
: drawLineOrBarChartValues(chart, options, ctx);
|
|
10637
|
+
break;
|
|
10638
|
+
}
|
|
10684
10639
|
ctx.restore();
|
|
10685
10640
|
},
|
|
10686
10641
|
};
|
|
10642
|
+
function drawTextWithBackground(text, x, y, ctx) {
|
|
10643
|
+
ctx.lineWidth = 3; // Stroke the text with a big lineWidth width to have some kind of background
|
|
10644
|
+
ctx.strokeText(text, x, y);
|
|
10645
|
+
ctx.lineWidth = 1;
|
|
10646
|
+
ctx.fillText(text, x, y);
|
|
10647
|
+
}
|
|
10648
|
+
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
10649
|
+
const yMax = chart.chartArea.bottom;
|
|
10650
|
+
const yMin = chart.chartArea.top;
|
|
10651
|
+
const textsPositions = {};
|
|
10652
|
+
for (const dataset of chart._metasets) {
|
|
10653
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10654
|
+
const value = dataset._parsed[i].y;
|
|
10655
|
+
const point = dataset.data[i];
|
|
10656
|
+
const xPosition = point.x;
|
|
10657
|
+
let yPosition = 0;
|
|
10658
|
+
if (chart.config.type === "line") {
|
|
10659
|
+
yPosition = point.y - 10;
|
|
10660
|
+
}
|
|
10661
|
+
else {
|
|
10662
|
+
yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
|
|
10663
|
+
}
|
|
10664
|
+
yPosition = Math.min(yPosition, yMax);
|
|
10665
|
+
yPosition = Math.max(yPosition, yMin);
|
|
10666
|
+
// Avoid overlapping texts with same X
|
|
10667
|
+
if (!textsPositions[xPosition]) {
|
|
10668
|
+
textsPositions[xPosition] = [];
|
|
10669
|
+
}
|
|
10670
|
+
for (const otherPosition of textsPositions[xPosition] || []) {
|
|
10671
|
+
if (Math.abs(otherPosition - yPosition) < 13) {
|
|
10672
|
+
yPosition = otherPosition - 13;
|
|
10673
|
+
}
|
|
10674
|
+
}
|
|
10675
|
+
textsPositions[xPosition].push(yPosition);
|
|
10676
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
10677
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10678
|
+
drawTextWithBackground(options.callback(value - 0), xPosition, yPosition, ctx);
|
|
10679
|
+
}
|
|
10680
|
+
}
|
|
10681
|
+
}
|
|
10682
|
+
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
10683
|
+
const xMax = chart.chartArea.right;
|
|
10684
|
+
const xMin = chart.chartArea.left;
|
|
10685
|
+
const textsPositions = {};
|
|
10686
|
+
for (const dataset of chart._metasets) {
|
|
10687
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10688
|
+
const value = dataset._parsed[i].x;
|
|
10689
|
+
const displayValue = options.callback(value - 0);
|
|
10690
|
+
const point = dataset.data[i];
|
|
10691
|
+
const yPosition = point.y;
|
|
10692
|
+
let xPosition = value < 0 ? point.x + point.width / 2 : point.x - point.width / 2;
|
|
10693
|
+
xPosition = Math.min(xPosition, xMax);
|
|
10694
|
+
xPosition = Math.max(xPosition, xMin);
|
|
10695
|
+
// Avoid overlapping texts with same Y
|
|
10696
|
+
if (!textsPositions[yPosition]) {
|
|
10697
|
+
textsPositions[yPosition] = [];
|
|
10698
|
+
}
|
|
10699
|
+
const textWidth = computeTextWidth(ctx, displayValue, { fontSize: 12 }, "px");
|
|
10700
|
+
for (const otherPosition of textsPositions[yPosition]) {
|
|
10701
|
+
if (Math.abs(otherPosition - xPosition) < textWidth) {
|
|
10702
|
+
xPosition = otherPosition + textWidth + 3;
|
|
10703
|
+
}
|
|
10704
|
+
}
|
|
10705
|
+
textsPositions[yPosition].push(xPosition);
|
|
10706
|
+
ctx.fillStyle = point.options.backgroundColor;
|
|
10707
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10708
|
+
drawTextWithBackground(displayValue, xPosition, yPosition, ctx);
|
|
10709
|
+
}
|
|
10710
|
+
}
|
|
10711
|
+
}
|
|
10712
|
+
function drawPieChartValues(chart, options, ctx) {
|
|
10713
|
+
for (const dataset of chart._metasets) {
|
|
10714
|
+
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
10715
|
+
const bar = dataset.data[i];
|
|
10716
|
+
const { startAngle, endAngle, innerRadius, outerRadius } = bar;
|
|
10717
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
10718
|
+
const midRadius = (innerRadius + outerRadius) / 2;
|
|
10719
|
+
const x = bar.x + midRadius * Math.cos(midAngle);
|
|
10720
|
+
const y = bar.y + midRadius * Math.sin(midAngle) + 7;
|
|
10721
|
+
ctx.fillStyle = chartFontColor(options.background);
|
|
10722
|
+
ctx.strokeStyle = options.background || "#ffffff";
|
|
10723
|
+
const value = options.callback(dataset._parsed[i]);
|
|
10724
|
+
drawTextWithBackground(value, x, y, ctx);
|
|
10725
|
+
}
|
|
10726
|
+
}
|
|
10727
|
+
}
|
|
10687
10728
|
|
|
10688
10729
|
/** This is a chartJS plugin that will draw connector lines between the bars of a Waterfall chart */
|
|
10689
10730
|
const waterfallLinesPlugin = {
|
|
@@ -23413,7 +23454,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
23413
23454
|
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
23414
23455
|
// tooltipItem.parsed can be an object or a number for pie charts
|
|
23415
23456
|
let yLabel = horizontalChart ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
23416
|
-
if (
|
|
23457
|
+
if (yLabel === undefined || yLabel === null) {
|
|
23417
23458
|
yLabel = tooltipItem.parsed;
|
|
23418
23459
|
}
|
|
23419
23460
|
const toolTipFormat = !format && Math.abs(yLabel) >= 1000 ? "#,##" : format;
|
|
@@ -46530,7 +46571,7 @@ function load(data, verboseImport) {
|
|
|
46530
46571
|
if (!data) {
|
|
46531
46572
|
return createEmptyWorkbookData();
|
|
46532
46573
|
}
|
|
46533
|
-
console.
|
|
46574
|
+
console.debug("### Loading data ###");
|
|
46534
46575
|
const start = performance.now();
|
|
46535
46576
|
if (data["[Content_Types].xml"]) {
|
|
46536
46577
|
const reader = new XlsxReader(data);
|
|
@@ -46544,13 +46585,13 @@ function load(data, verboseImport) {
|
|
|
46544
46585
|
// apply migrations, if needed
|
|
46545
46586
|
if ("version" in data) {
|
|
46546
46587
|
if (data.version < CURRENT_VERSION) {
|
|
46547
|
-
console.
|
|
46588
|
+
console.debug("Migrating data from version", data.version);
|
|
46548
46589
|
data = migrate(data);
|
|
46549
46590
|
}
|
|
46550
46591
|
}
|
|
46551
46592
|
data = repairData(data);
|
|
46552
|
-
console.
|
|
46553
|
-
console.
|
|
46593
|
+
console.debug("Data loaded in", performance.now() - start, "ms");
|
|
46594
|
+
console.debug("###");
|
|
46554
46595
|
return data;
|
|
46555
46596
|
}
|
|
46556
46597
|
function migrate(data) {
|
|
@@ -46559,7 +46600,7 @@ function migrate(data) {
|
|
|
46559
46600
|
for (let i = index; i < MIGRATIONS.length; i++) {
|
|
46560
46601
|
data = MIGRATIONS[i].applyMigration(data);
|
|
46561
46602
|
}
|
|
46562
|
-
console.
|
|
46603
|
+
console.debug("Data migrated in", performance.now() - start, "ms");
|
|
46563
46604
|
return data;
|
|
46564
46605
|
}
|
|
46565
46606
|
const MIGRATIONS = [
|
|
@@ -54119,7 +54160,7 @@ class Evaluator {
|
|
|
54119
54160
|
cellsToCompute.addMany(arrayFormulasPositions);
|
|
54120
54161
|
cellsToCompute.addMany(this.getCellsDependingOn(arrayFormulasPositions));
|
|
54121
54162
|
this.evaluate(cellsToCompute);
|
|
54122
|
-
console.
|
|
54163
|
+
console.debug("evaluate Cells", performance.now() - start, "ms");
|
|
54123
54164
|
}
|
|
54124
54165
|
getArrayFormulasImpactedByChangesOf(positions) {
|
|
54125
54166
|
const impactedPositions = this.createEmptyPositionSet();
|
|
@@ -54158,7 +54199,7 @@ class Evaluator {
|
|
|
54158
54199
|
const start = performance.now();
|
|
54159
54200
|
this.evaluatedCells = new PositionMap();
|
|
54160
54201
|
this.evaluate(this.getAllCells());
|
|
54161
|
-
console.
|
|
54202
|
+
console.debug("evaluate all cells", performance.now() - start, "ms");
|
|
54162
54203
|
}
|
|
54163
54204
|
evaluateFormulaResult(sheetId, formulaString) {
|
|
54164
54205
|
try {
|
|
@@ -57308,7 +57349,7 @@ class Session extends EventBus {
|
|
|
57308
57349
|
this.onMessageReceived(message);
|
|
57309
57350
|
}
|
|
57310
57351
|
this.isReplayingInitialRevisions = false;
|
|
57311
|
-
console.
|
|
57352
|
+
console.debug("Replayed", numberOfCommands, "commands in", performance.now() - start, "ms");
|
|
57312
57353
|
}
|
|
57313
57354
|
/**
|
|
57314
57355
|
* Notify the server that the user client left the collaborative session
|
|
@@ -67918,7 +67959,7 @@ class Model extends EventBus {
|
|
|
67918
67959
|
coreHandlers = [];
|
|
67919
67960
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
67920
67961
|
const start = performance.now();
|
|
67921
|
-
console.
|
|
67962
|
+
console.debug("##### Model creation #####");
|
|
67922
67963
|
super();
|
|
67923
67964
|
setDefaultTranslationMethod();
|
|
67924
67965
|
stateUpdateMessages = repairInitialMessages(data, stateUpdateMessages);
|
|
@@ -67990,16 +68031,16 @@ class Model extends EventBus {
|
|
|
67990
68031
|
this.joinSession();
|
|
67991
68032
|
if (config.snapshotRequested) {
|
|
67992
68033
|
const startSnapshot = performance.now();
|
|
67993
|
-
console.
|
|
68034
|
+
console.debug("Snapshot requested");
|
|
67994
68035
|
this.session.snapshot(this.exportData());
|
|
67995
68036
|
this.garbageCollectExternalResources();
|
|
67996
|
-
console.
|
|
68037
|
+
console.debug("Snapshot taken in", performance.now() - startSnapshot, "ms");
|
|
67997
68038
|
}
|
|
67998
68039
|
// mark all models as "raw", so they will not be turned into reactive objects
|
|
67999
68040
|
// by owl, since we do not rely on reactivity
|
|
68000
68041
|
markRaw(this);
|
|
68001
|
-
console.
|
|
68002
|
-
console.
|
|
68042
|
+
console.debug("Model created in", performance.now() - start, "ms");
|
|
68043
|
+
console.debug("######");
|
|
68003
68044
|
}
|
|
68004
68045
|
joinSession() {
|
|
68005
68046
|
this.session.join(this.config.client);
|
|
@@ -68222,7 +68263,7 @@ class Model extends EventBus {
|
|
|
68222
68263
|
this.finalize();
|
|
68223
68264
|
const time = performance.now() - start;
|
|
68224
68265
|
if (time > 5) {
|
|
68225
|
-
console.
|
|
68266
|
+
console.debug(type, time, "ms");
|
|
68226
68267
|
}
|
|
68227
68268
|
});
|
|
68228
68269
|
this.session.save(command, commands, changes);
|
|
@@ -68565,6 +68606,6 @@ const constants = {
|
|
|
68565
68606
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
68566
68607
|
|
|
68567
68608
|
|
|
68568
|
-
__info__.version = "17.4.
|
|
68569
|
-
__info__.date = "2024-10-
|
|
68570
|
-
__info__.hash = "
|
|
68609
|
+
__info__.version = "17.4.10";
|
|
68610
|
+
__info__.date = "2024-10-24T08:54:56.262Z";
|
|
68611
|
+
__info__.hash = "c82d9c1";
|