Every undoable edit of a chart is a TSCH command message, the same set
Pages and Numbers use. Apple has not published them; the definitions below are those
iWorkFileFormat recovered from Keynote 6.0 (2013), so later versions may add fields. This
page lists every message of TSCHCommandArchives.proto. The chart messages
they refer to are on the
charts page; the shared
TSK.CommandArchive base on
undo commands. Notation:
req required, rep repeated, the rest optional; each field is
number name : type; a bracketed number is the message type from
message type numbers. A message
without a number has none in the registry that was read. Ref is
TSP.Reference and ChartCmd is
TSCH.ChartCommandArchive. The source gives only the shape of each command;
the descriptions are read from the names and are not confirmed by Apple.
Base and enumerations
message ChartCommandArchive { // type 5126
req TSK.CommandArchive super = 1; req Ref info = 2; 3 bool original_dirty_state
}
message SynchronousCommandArchive { // type 5113
req TSK.CommandArchive super = 1; req Ref command = 2
}
enum StyleOwnerType { chart_info = 1; legend_model = 2; chart_axis = 3; chart_series = 4 }
enum StyleSwapType {
chart_style = 1; chart_non_style = 2; legend_style = 3; legend_non_style = 4;
value_axis_style = 5; value_axis_non_style = 6; category_axis_style = 7;
category_axis_non_style = 8; series_theme_style = 9; series_private_style = 10;
series_non_style = 11; paragraph_style = 12
}
enum ApplyPresetBehavior { remove_overrides = 1; preserve_overrides = 2;
preserve_appearance = 3 }
The style and non-style pairs in StyleSwapType match the
two halves of each chart element on the charts page: the style (shared, from the
theme) and the non-style (properties specific to this chart).
Data grid and names
The chart keeps its numbers in a grid of rows and columns (see the chart data section of the charts page); these commands change it. A row and a column of the grid are a series and a category, or the other way round, depending on the grid direction.
message CommandSetSeriesNameArchive { // type 5104
req ChartCmd super = 1; req uint32 seriesIndex = 2; req string oldName = 3;
req string newName = 4
}
message CommandSetCategoryNameArchive { // type 5105
req ChartCmd super = 1; req uint32 categoryIndex = 2; req string oldName = 3;
req string newName = 4; 5 bool isMultiDataIndex
}
message CommandSetGridValueArchive { // type 5109
req ChartCmd super = 1; req uint32 rowindex = 2; req uint32 columnindex = 3;
req double oldvalue = 4; req double newvalue = 5
}
message CommandReplaceGridValuesArchive { // type 5127
message ValueRow { rep double value = 1 }
req ChartCmd super = 1; req uint32 rowindex = 2; req uint32 columnindex = 3;
rep ValueRow old_data_rows = 4; rep ValueRow new_data_rows = 5;
rep string old_row_names = 6; rep string new_row_names = 7;
rep string old_col_names = 8; rep string new_col_names = 9;
10 uint32 rows_to_add; 11 uint32 cols_to_add
}
message CommandAddGridRowsArchive { // type 5115
req ChartCmd super = 1; req uint32 location = 2; 3 uint32 length; rep string name = 4
}
message CommandAddGridColumnsArchive { // type 5116
req ChartCmd super = 1; req uint32 location = 2; 3 uint32 length; rep string name = 4
}
message CommandMoveGridRowsArchive { // type 5118
req ChartCmd super = 1; req uint32 location = 2; req uint32 length = 3;
req int32 afterrow = 4
}
message CommandMoveGridColumnsArchive { // type 5119
req ChartCmd super = 1; req uint32 location = 2; req uint32 length = 3;
req int32 aftercolumn = 4
}
message CommandDeleteGridRowsArchive { // type 5120
message ValueRow { rep double value = 5 }
req ChartCmd super = 1; req uint32 location = 2; req uint32 length = 3;
rep string names = 4; rep ValueRow value_row = 6; 7 bool removed_all_rows;
rep string column_names = 8
}
message CommandDeleteGridColumnsArchive { // type 5121
message ValueRow { rep double value = 5 }
req ChartCmd super = 1; req uint32 location = 2; req uint32 length = 3;
rep string names = 4; rep ValueRow value_row = 6; 7 bool removed_all_columns;
rep string row_names = 8
}
message CommandSetGridDirectionArchive { // type 5110
req ChartCmd super = 1; req uint32 old_direction = 2; req uint32 new_direction = 3
}
message CommandSetMultiDataSetIndexArchive { // type 5130
req ChartCmd super = 1; req uint32 oldindex = 2; req uint32 newindex = 3
}
The two ValueRow messages in the delete commands number their field 5,
while the one in CommandReplaceGridValues numbers it 1; that is as the
source gives them. The numeric codes for the grid direction are not named (unknown).
The delete commands save the removed values in value_row, so that undo can
put them back.
Chart type, series and layout
message CommandSetChartTypeArchive { // type 5103
req ChartCmd super = 1; req ChartType oldChartType = 2; req ChartType newChartType = 3;
5 Ref info_geometry_command; 6 Ref anchor_attachment_command;
7 RectArchive original_legend_rect
}
message CommandSetSeriesTypeArchive { // no number
req ChartCmd super = 1; req uint32 seriesindex = 2; req uint32 oldtype = 3;
req uint32 newtype = 4
}
message CommandSetScatterFormatArchive { // type 5107
req ChartCmd super = 1; req uint32 oldformat = 3; req uint32 newformat = 4
}
message CommandSetLegendFrameArchive { // type 5108
req ChartCmd super = 1; req RectArchive old_legend_frame = 2;
req RectArchive new_legend_frame = 3
}
message CommandSetPreviewLocArchive { // type 5117
req ChartCmd super = 1; req TSP.Point old_loc = 2; req TSP.Point new_loc = 3
}
message CommandSetPieWedgeExplosion { // type 5122
req ChartCmd super = 1; 2 Ref info_geometry_command; 3 Ref style_mutation_command;
4 Ref anchor_attachment_command
}
message CommandCleanupGeometryArchive { // no number
req ChartCmd super = 1; 2 Ref info_geometry_command; 3 Ref anchor_attachment_command;
4 RectArchive original_legend_rect
}
ChartType and RectArchive are on the
charts page. A series type
in CommandSetSeriesType is an unnamed integer code (unknown; the source
does not link it to ChartType).
Styles, themes and presets
message PropertyMutationUndoTupleArchive { // no number
1 Ref chart_info; 2 StyleOwnerType style_owner_type; 3 uint32 index;
4 Ref old_style; 5 Ref new_style; 6 Ref old_non_style; 7 Ref new_non_style
}
message StyleSwapUndoTupleArchive { // no number
1 Ref chart_info; 2 StyleSwapType swap_type; 3 uint32 index; 4 Ref old_value;
5 Ref new_value
}
message CommandStyleSwapArchive { // type 5123
req ChartCmd super = 1; rep StyleSwapUndoTupleArchive undo_tuples = 2
}
message CommandChartApplyTheme { // type 5124
req TSS.ApplyThemeChildCommandArchive super = 1; req Ref info = 2; 3 Ref swap_command;
4 Ref preset
}
message CommandChartApplyPreset { // type 5125
req ChartCmd super = 1; 2 Ref swap_command; 3 Ref preset;
4 ApplyPresetBehavior behavior [default = remove_overrides]
}
message CommandReplaceThemePresetArchive { // type 5131
message StyleAndIdentifierPair { req Ref style = 1; req string identifier = 2 }
req TSK.CommandArchive super = 1; req Ref theme = 2; 3 Ref old_preset; 4 Ref new_preset;
rep StyleAndIdentifierPair identifiers = 5; 6 uint64 old_preset_index
}
message CommandReplaceAllArchive { // type 5114
req TSK.ReplaceAllChildCommandArchive super = 1; req Ref info = 2; rep Ref commands = 3
}
message CommandInvalidateWPCaches { // type 5132
req TSK.CommandArchive super = 1
}
The type registry also lists 5129, TSCH.StylePasteboardDataArchive,
which is not a command; its fields are on the
charts page.
WP in CommandInvalidateWPCaches is not explained by the
source (probably the word-processing layout, as in the table commands, but that is a
guess).