Variables: Import Data Sets reads % columns of graph data files

dataset.import refused every header cell that starts with % unless it was
a variable's exact name, so the five-column example on the data source
set-up page did not import. A %Name header now defines the graph variable
Name, or names it when the document has it, and each cell of the column is
the path of a graph data file. The file is read as the Graph Data window's
Import Data reads one, and the data becomes the data set's graph value,
which applies as graph.setData applies it.

A relative path is taken from the new base parameter, else from the folder
of the CSV file at path. A file that is missing, can't be read or is larger
than 1 MB, a file that gives a graph value longer than 256 KB, and %
columns that hold more than 256 MB in all refuse the import with the line
and the column, and the document is left as it was. Each file is read once
per import.

Import Data's text decoding, cell splitting and sheet-to-data steps move
from the Graph Data dialog to the engine (graph/data.rs), so both imports
read a file the same way. dataset.export's warning now lists a % header
over values as refused and a %-prefixed variable of another kind as read
back with another kind.
This commit is contained in:
dotCooCoo
2026-11-14 22:07:06 -08:00
parent d094a3c449
commit 8f5aed7ea4
26 changed files with 463 additions and 119 deletions
+4
View File
@@ -896,6 +896,10 @@ pub use brushsym::reset_transformation_changes;
/// Data window reads files by it too).
pub use variablecmds::utf16_order_without_mark;
/// How the Graph Data window's Import Data and Import Data Sets' `%` columns read a graph data
/// file: its size limit, its text, its cells and the data `graph.setData` takes from them.
pub use graph::{MAX_GRAPH_DATA_FILE, graph_cell_text, graph_data_from_grid, graph_data_text, graph_grid_from_text};
/// Command ids kept only so older scripts keep working: `(alias, the command it duplicates)`.
/// They run as before but the command palette leaves them out (it lists the command once).
pub const ALIASES: &[(&str, &str)] = &[("object.convertDocumentColorMode", "file.documentColorMode")];