-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransformOptions.cs
More file actions
78 lines (58 loc) · 2.67 KB
/
Copy pathTransformOptions.cs
File metadata and controls
78 lines (58 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using JSONstat.Models;
namespace JSONstat.Transform;
/// <summary>The tabular output shape of <see cref="Dataset.Transform"/>.</summary>
public enum TransformType
{
/// <summary>An array of arrays (a header row followed by data rows).</summary>
ArrayOfArrays,
/// <summary>An array of objects (one object per cell).</summary>
ArrayOfObjects,
/// <summary>An object whose values are column arrays.</summary>
ObjectOfArrays,
/// <summary>An object keyed by a composite of the cell coordinates.</summary>
Object
}
/// <summary>Whether to use ids or labels for the dimension field (column key).</summary>
public enum TransformField
{
/// <summary>Use the dimension id.</summary>
Id,
/// <summary>Use the dimension label.</summary>
Label
}
/// <summary>Whether to use ids or labels for the category content (cell value).</summary>
public enum TransformContent
{
/// <summary>Use the category id.</summary>
Id,
/// <summary>Use the category label.</summary>
Label
}
/// <summary>Options for <see cref="Dataset.Transform"/>.</summary>
public sealed class TransformOptions
{
/// <summary>The output shape. Defaults to <see cref="TransformType.ArrayOfArrays"/>.</summary>
public TransformType Type { get; set; } = TransformType.ArrayOfArrays;
/// <summary>Dimension field form. <c>null</c> = type-dependent default
/// (<see cref="TransformField.Label"/> for <see cref="TransformType.ArrayOfArrays"/>,
/// <see cref="TransformField.Id"/> otherwise).</summary>
public TransformField? Field { get; set; }
/// <summary>Category content form. <c>null</c> = <see cref="TransformContent.Label"/>.</summary>
public TransformContent? Content { get; set; }
/// <summary>Include the status column. Defaults to <c>false</c>.</summary>
public bool Status { get; set; }
/// <summary>Label for the value column. Defaults to "Value".</summary>
public string ValueLabel { get; set; } = "Value";
/// <summary>Label for the status column. Defaults to "Status".</summary>
public string StatusLabel { get; set; } = "Status";
/// <summary>Include metadata (reserved; currently ignored).</summary>
public bool Meta { get; set; }
/// <summary>Dimension id to transpose on (reserved; currently ignored).</summary>
public string? By { get; set; }
/// <summary>Prefix for transposed properties (reserved; currently ignored).</summary>
public string? Prefix { get; set; }
/// <summary>Dimension ids to exclude from the output.</summary>
public string[]? Drop { get; set; }
/// <summary>Use a comma decimal mark for values. Defaults to <c>false</c>.</summary>
public bool Comma { get; set; }
}