@trebco/treb 28.5.1 → 28.7.0
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/treb-spreadsheet-light.mjs +15 -15
- package/dist/treb-spreadsheet.mjs +15 -15
- package/dist/treb.d.ts +1 -1
- package/package.json +1 -1
- package/treb-base-types/src/api_types.ts +1 -1
- package/treb-base-types/src/area.ts +1 -1
- package/treb-base-types/src/basic_types.ts +21 -21
- package/treb-base-types/src/cell.ts +1 -1
- package/treb-base-types/src/cells.ts +1 -1
- package/treb-base-types/src/color.ts +1 -1
- package/treb-base-types/src/dom-utilities.ts +1 -1
- package/treb-base-types/src/import.ts +1 -1
- package/treb-base-types/src/index-standalone.ts +9 -9
- package/treb-base-types/src/index.ts +1 -1
- package/treb-base-types/src/layout.ts +21 -21
- package/treb-base-types/src/localization.ts +21 -21
- package/treb-base-types/src/rectangle.ts +1 -1
- package/treb-base-types/src/render_text.ts +1 -1
- package/treb-base-types/src/style.ts +1 -1
- package/treb-base-types/src/table.ts +1 -1
- package/treb-base-types/src/text_part.ts +21 -21
- package/treb-base-types/src/theme.ts +1 -1
- package/treb-base-types/src/union.ts +1 -1
- package/treb-base-types/src/value-type.ts +1 -1
- package/treb-base-types/style/resizable.css +21 -21
- package/treb-calculator/src/calculator.ts +1 -1
- package/treb-calculator/src/complex-math.ts +1 -1
- package/treb-calculator/src/dag/array-vertex.ts +1 -1
- package/treb-calculator/src/dag/calculation_leaf_vertex.ts +1 -1
- package/treb-calculator/src/dag/graph.ts +1 -1
- package/treb-calculator/src/dag/spreadsheet_vertex.ts +1 -1
- package/treb-calculator/src/dag/spreadsheet_vertex_base.ts +21 -21
- package/treb-calculator/src/dag/state_leaf_vertex.ts +1 -1
- package/treb-calculator/src/dag/vertex.ts +21 -21
- package/treb-calculator/src/descriptors.ts +1 -1
- package/treb-calculator/src/expression-calculator.ts +1 -1
- package/treb-calculator/src/function-error.ts +1 -1
- package/treb-calculator/src/function-library.ts +1 -1
- package/treb-calculator/src/functions/base-functions.ts +1 -1
- package/treb-calculator/src/functions/checkbox.ts +1 -1
- package/treb-calculator/src/functions/complex-functions.ts +1 -1
- package/treb-calculator/src/functions/finance-functions.ts +1 -1
- package/treb-calculator/src/functions/information-functions.ts +1 -1
- package/treb-calculator/src/functions/matrix-functions.ts +1 -1
- package/treb-calculator/src/functions/sparkline.ts +1 -1
- package/treb-calculator/src/functions/statistics-functions.ts +1 -1
- package/treb-calculator/src/functions/text-functions.ts +1 -1
- package/treb-calculator/src/index.ts +1 -1
- package/treb-calculator/src/notifier-types.ts +1 -1
- package/treb-calculator/src/primitives.ts +1 -1
- package/treb-calculator/src/utilities.ts +1 -1
- package/treb-charts/src/chart-functions.ts +1 -1
- package/treb-charts/src/chart-types.ts +21 -21
- package/treb-charts/src/chart-utils.ts +696 -0
- package/treb-charts/src/chart.ts +92 -1291
- package/treb-charts/src/default-chart-renderer.ts +535 -0
- package/treb-charts/src/index.ts +5 -4
- package/treb-charts/src/main.ts +17 -17
- package/treb-charts/src/rectangle.ts +21 -21
- package/treb-charts/src/renderer-type.ts +32 -0
- package/treb-charts/src/renderer.ts +1 -1
- package/treb-charts/src/util.ts +1 -1
- package/treb-charts/style/charts.scss +1 -1
- package/treb-charts/style/old-charts.scss +21 -21
- package/treb-embed/src/embedded-spreadsheet.ts +15 -12
- package/treb-embed/src/language-model.ts +1 -1
- package/treb-embed/src/options.ts +30 -1
- package/treb-embed/src/progress-dialog.ts +1 -1
- package/treb-embed/src/spinner.ts +1 -1
- package/treb-embed/src/types.ts +1 -1
- package/treb-embed/style/autocomplete.scss +1 -1
- package/treb-embed/style/dark-theme.scss +1 -1
- package/treb-embed/style/defaults.scss +1 -1
- package/treb-embed/style/dialog.scss +1 -1
- package/treb-embed/style/dropdown-select.scss +1 -1
- package/treb-embed/style/formula-bar.scss +1 -1
- package/treb-embed/style/grid.scss +1 -1
- package/treb-embed/style/mouse-mask.scss +1 -1
- package/treb-embed/style/note.scss +1 -1
- package/treb-embed/style/overlay-editor.scss +1 -1
- package/treb-embed/style/spinner.scss +1 -1
- package/treb-embed/style/tab-bar.scss +1 -1
- package/treb-embed/style/table.scss +1 -1
- package/treb-embed/style/theme-defaults.scss +1 -1
- package/treb-embed/style/tooltip.scss +1 -1
- package/treb-embed/style/z-index.scss +1 -1
- package/treb-export/src/address-type.ts +21 -21
- package/treb-export/src/base-template.ts +1 -1
- package/treb-export/src/column-width.ts +1 -1
- package/treb-export/src/drawing2/chart-template-components2.ts +1 -1
- package/treb-export/src/drawing2/chart2.ts +1 -1
- package/treb-export/src/drawing2/column-chart-template2.ts +1 -1
- package/treb-export/src/drawing2/donut-chart-template2.ts +1 -1
- package/treb-export/src/drawing2/drawing2.ts +1 -1
- package/treb-export/src/drawing2/embedded-image.ts +1 -1
- package/treb-export/src/drawing2/scatter-chart-template2.ts +1 -1
- package/treb-export/src/export-worker/export-worker.ts +1 -1
- package/treb-export/src/export-worker/index.worker.ts +1 -1
- package/treb-export/src/export2.ts +1 -1
- package/treb-export/src/import2.ts +1 -1
- package/treb-export/src/relationship.ts +1 -1
- package/treb-export/src/shared-strings2.ts +1 -1
- package/treb-export/src/template-2.ts +2 -2
- package/treb-export/src/workbook-sheet2.ts +1 -1
- package/treb-export/src/workbook-style2.ts +1 -1
- package/treb-export/src/workbook-theme2.ts +1 -1
- package/treb-export/src/workbook2.ts +1 -1
- package/treb-export/src/xml-utils.ts +1 -1
- package/treb-format/src/format.test.ts +21 -21
- package/treb-format/src/format.ts +1 -1
- package/treb-format/src/format_cache.ts +21 -21
- package/treb-format/src/format_parser.ts +1 -1
- package/treb-format/src/index.ts +4 -4
- package/treb-format/src/number_format_section.ts +21 -21
- package/treb-format/src/value_parser.ts +1 -1
- package/treb-grid/src/editors/autocomplete.ts +1 -1
- package/treb-grid/src/editors/autocomplete_matcher.ts +21 -21
- package/treb-grid/src/editors/editor.ts +1 -1
- package/treb-grid/src/editors/formula_bar.ts +1 -1
- package/treb-grid/src/editors/overlay_editor.ts +1 -1
- package/treb-grid/src/index.ts +1 -1
- package/treb-grid/src/layout/base_layout.ts +1 -1
- package/treb-grid/src/layout/grid_layout.ts +1 -1
- package/treb-grid/src/layout/rectangle_cache.ts +21 -21
- package/treb-grid/src/render/selection-renderer.ts +1 -1
- package/treb-grid/src/render/svg_header_overlay.ts +1 -1
- package/treb-grid/src/render/svg_selection_block.ts +1 -1
- package/treb-grid/src/render/tile_renderer.ts +1 -1
- package/treb-grid/src/types/annotation.ts +1 -1
- package/treb-grid/src/types/border_constants.ts +1 -1
- package/treb-grid/src/types/clipboard_data.ts +1 -1
- package/treb-grid/src/types/data_model.ts +1 -1
- package/treb-grid/src/types/drag_mask.ts +21 -21
- package/treb-grid/src/types/grid.ts +1 -1
- package/treb-grid/src/types/grid_base.ts +1 -1
- package/treb-grid/src/types/grid_command.ts +1 -1
- package/treb-grid/src/types/grid_events.ts +1 -1
- package/treb-grid/src/types/grid_options.ts +1 -1
- package/treb-grid/src/types/grid_selection.ts +1 -1
- package/treb-grid/src/types/named_range.ts +1 -1
- package/treb-grid/src/types/scale-control.ts +1 -1
- package/treb-grid/src/types/serialize_options.ts +1 -1
- package/treb-grid/src/types/set_range_options.ts +1 -1
- package/treb-grid/src/types/sheet.ts +1 -1
- package/treb-grid/src/types/sheet_types.ts +1 -1
- package/treb-grid/src/types/tab_bar.ts +1 -1
- package/treb-grid/src/types/tile.ts +21 -21
- package/treb-grid/src/types/update_flags.ts +1 -1
- package/treb-grid/src/util/fontmetrics2.ts +1 -1
- package/treb-grid/src/util/ua.ts +21 -21
- package/treb-parser/src/csv-parser.ts +21 -21
- package/treb-parser/src/index.ts +5 -5
- package/treb-parser/src/md-parser.ts +1 -1
- package/treb-parser/src/parser-types.ts +1 -1
- package/treb-parser/src/parser.test.ts +21 -21
- package/treb-parser/src/parser.ts +1 -1
- package/treb-utils/src/event_source.ts +1 -1
- package/treb-utils/src/ievent_source.ts +13 -13
- package/treb-utils/src/index.ts +1 -1
- package/treb-utils/src/measurement.ts +1 -1
- package/treb-utils/src/scale.ts +21 -21
- package/treb-utils/src/serialize_html.ts +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of TREB.
|
|
3
|
-
*
|
|
4
|
-
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
-
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
-
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
-
* later version.
|
|
8
|
-
*
|
|
9
|
-
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
-
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
-
* details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU General Public License along
|
|
15
|
-
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
-
*
|
|
17
|
-
* Copyright 2022-
|
|
18
|
-
* info@treb.app
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2024 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
22
|
/**
|
|
23
23
|
* NOTE: this file uses the color-mod() function and a postcss library
|
|
24
24
|
* to translate it. that function is no longer in the spec and will be
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* You should have received a copy of the GNU General Public License along
|
|
15
15
|
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*
|
|
17
|
-
* Copyright 2022-
|
|
17
|
+
* Copyright 2022-2024 trebco, llc.
|
|
18
18
|
* info@treb.app
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
@@ -1030,10 +1030,9 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
1030
1030
|
// this.grid.headless = true; // ensure
|
|
1031
1031
|
}
|
|
1032
1032
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
// this.calculator = new type();
|
|
1033
|
+
if (options.preload) {
|
|
1034
|
+
options.preload.call(0, this);
|
|
1035
|
+
}
|
|
1037
1036
|
|
|
1038
1037
|
// FIXME: this should yield so we can subscribe to events before the initial load
|
|
1039
1038
|
|
|
@@ -1997,18 +1996,23 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
1997
1996
|
|
|
1998
1997
|
/**
|
|
1999
1998
|
* Create (and return) a Chart object.
|
|
2000
|
-
*
|
|
2001
|
-
* @privateRemarks
|
|
2002
|
-
*
|
|
2003
|
-
* This method was created for RAW, no one else should need it. But it's
|
|
2004
|
-
* not really an internal method, because it's used by outside clients.
|
|
2005
|
-
*
|
|
2006
1999
|
* @internal
|
|
2007
2000
|
*/
|
|
2008
2001
|
public CreateChart(): Chart {
|
|
2002
|
+
|
|
2009
2003
|
if (this.calculator.RegisterLibrary('treb-charts', ChartFunctions)) {
|
|
2010
2004
|
this.UpdateAC();
|
|
2011
2005
|
}
|
|
2006
|
+
|
|
2007
|
+
if (this.options.chart_renderer) {
|
|
2008
|
+
if (typeof this.options.chart_renderer === 'function') {
|
|
2009
|
+
return new Chart(this.options.chart_renderer());
|
|
2010
|
+
}
|
|
2011
|
+
else {
|
|
2012
|
+
return new Chart(this.options.chart_renderer);
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2012
2016
|
return new Chart();
|
|
2013
2017
|
}
|
|
2014
2018
|
|
|
@@ -5036,7 +5040,6 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
5036
5040
|
{
|
|
5037
5041
|
|
|
5038
5042
|
const chart = this.CreateChart();
|
|
5039
|
-
// const chart = new Chart();
|
|
5040
5043
|
chart.Initialize(view.content_node);
|
|
5041
5044
|
|
|
5042
5045
|
//if (this.calculator.RegisterLibrary('treb-charts', ChartFunctions)) {
|
|
@@ -14,13 +14,19 @@
|
|
|
14
14
|
* You should have received a copy of the GNU General Public License along
|
|
15
15
|
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*
|
|
17
|
-
* Copyright 2022-
|
|
17
|
+
* Copyright 2022-2024 trebco, llc.
|
|
18
18
|
* info@treb.app
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import type { ICellAddress } from 'treb-base-types';
|
|
23
23
|
import type { TREBDocument } from './types';
|
|
24
|
+
import type { ChartRenderer } from 'treb-charts';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* factory type for chart renderer, if you want instances (pass a constructor)
|
|
28
|
+
*/
|
|
29
|
+
export type ChartRendererFactory = () => ChartRenderer;
|
|
24
30
|
|
|
25
31
|
/**
|
|
26
32
|
* options for exporting CSV/TSV
|
|
@@ -275,6 +281,29 @@ export interface EmbeddedSpreadsheetOptions {
|
|
|
275
281
|
*/
|
|
276
282
|
revert_indicator?: boolean;
|
|
277
283
|
|
|
284
|
+
/**
|
|
285
|
+
* @internal
|
|
286
|
+
* overload the chart renderer with your own type (or a type factory method).
|
|
287
|
+
* use a factory if you are going to persist state in the renderer, otherwise
|
|
288
|
+
* you can just use a single instance.
|
|
289
|
+
*/
|
|
290
|
+
chart_renderer?: ChartRenderer|ChartRendererFactory;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @internal
|
|
294
|
+
*
|
|
295
|
+
* optional function to run before loading data. this is useful for example
|
|
296
|
+
* if you want to load some custom functions before a document is loaded
|
|
297
|
+
* from local storage. otherwise you'll get #NAME errors when an unknown
|
|
298
|
+
* function is loaded (I suppose you could recalc, but this is better).
|
|
299
|
+
*
|
|
300
|
+
* @privateRemarks
|
|
301
|
+
* I'd prefer to pass the instance as a parameter, but I don't want a
|
|
302
|
+
* circular reference here. maybe that's not an issue? for the time being
|
|
303
|
+
* we'll treat it as opaque.
|
|
304
|
+
*/
|
|
305
|
+
preload?: (instance: unknown) => void;
|
|
306
|
+
|
|
278
307
|
}
|
|
279
308
|
|
|
280
309
|
/**
|
package/treb-embed/src/types.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of TREB.
|
|
3
|
-
*
|
|
4
|
-
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
-
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
-
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
-
* later version.
|
|
8
|
-
*
|
|
9
|
-
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
-
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
-
* details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU General Public License along
|
|
15
|
-
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
-
*
|
|
17
|
-
* Copyright 2022-
|
|
18
|
-
* info@treb.app
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2024 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
22
|
/** represents address in a sheet */
|
|
23
23
|
export interface AddressType {
|
|
24
24
|
row: number;
|