V2.x Options - j-brooke/FracturedJson GitHub Wiki
Options (for Version 2.x)
The following options control how the JSON data is formatted. This page applies to version 2.x releases. Click here for the version 1.x options. Click here for the latest version.
MaxInlineLength
Maximum length of a complex element on a single line, or of each line in a compact array. This includes only the data for the inlined element, not indentation or leading property names.
Example:
MaxInlineLength=80
{
"LongArray": [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131,
137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
],
"ComplexObject": {
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
"Subthing2": { "Q": null, "W": [-2, -1, 0, 1] },
"Distraction": [[], null, null]
}
}
MaxInlineLength=30
{
"LongArray": [
2, 3, 5, 7, 11, 13,
17, 19, 23, 29, 31, 37,
41, 43, 47, 53, 59, 61,
67, 71, 73, 79, 83, 89,
97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151,
157, 163, 167, 173, 179, 181,
191, 193, 197, 199
],
"ComplexObject": {
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
"Subthing2": {
"Q": null,
"W": [-2, -1, 0, 1]
},
"Distraction": [[], null, null]
}
}
MaxInlineComplexity
Maximum nesting level that can be displayed on a single line. A primitive type or an empty array or object has a complexity of 0. An object or array has a complexity of 1 greater than its most complex child.
Example:
MaxInlineComplexity=2
{
"ComplexObject": {
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
"Subthing2": { "Q": null, "W": [-2, -1, 0, 1] },
"Distraction": [[], null, null]
}
}
MaxInlineComplexity=1
{
"ComplexObject": {
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
"Subthing2": {
"Q": null,
"W": [-2, -1, 0, 1]
},
"Distraction": [[], null, null]
}
}
MaxCompactArrayComplexity
Maximum nesting level that can be arranged spanning multiple lines, with multiple items per line.
Example:
MaxCompactArrayComplexity=1
{
"LongArray": [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131,
137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
],
"LongArray2": [
[ 19, 2 ],
[ 3, 8 ],
[ 14, 0 ],
[ 9, 9 ],
[ 9, 9 ],
[ 0, 3 ],
[ 10, 1 ],
[ 9, 1 ],
[ 9, 2 ],
[ 6, 13 ],
[ 18, 5 ],
[ 4, 11 ],
[ 12, 2 ]
]
}
MaxCompactArrayComplexity=2
{
"LongArray": [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131,
137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
],
"LongArray2": [
[19, 2], [3, 8], [14, 0], [9, 9], [9, 9], [0, 3], [10, 1], [9, 1], [9, 2],
[6, 13], [18, 5], [4, 11], [12, 2]
]
}
NestedBracketPadding
If an inlined array or object contains other (non-empty) arrays or objects, setting NestedBracketPadding to true will include spaces inside the outer brackets. (This doesn't apply if they are table-formatted.)
Example:
NestedBracketPadding=true
[
{ "type": "turret", "loc": {"x": 47, "y": -4}, "flags": ["stationary"] },
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} }
]
NestedBracketPadding=false
[
{"type": "turret", "loc": {"x": 47, "y": -4}, "flags": ["stationary"]},
{"type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0}}
]
SimpleBracketPadding
Determines whether spaces should be included inside object/array brackets when they only have primitive types as children.
SimpleBracketPadding=false
{
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
"Subthing2": { "Q": null, "W": [-2, -1, 0, 1] },
"Distraction": [[], null, null]
}
SimpleBracketPadding=true
{
"Subthing1": { "X": 55, "Y": 19, "Z": -4 },
"Subthing2": { "Q": null, "W": [ -2, -1, 0, 1 ] },
"Distraction": [ [], null, null ]
}
ColonPadding
If true, includes a space after property colons.
Example:
ColonPadding=true
{
"TeamId": 2,
"Placements": [
{ "UnitType": "Archer" , "Position": [41, 7] },
{ "UnitType": "Pikeman" , "Position": [40, 7] },
{ "UnitType": "Barricade", "Position": [39, 7] }
]
}
ColonPadding=false
{
"TeamId":2,
"Placements":[
{ "UnitType":"Archer" , "Position":[41, 7] },
{ "UnitType":"Pikeman" , "Position":[40, 7] },
{ "UnitType":"Barricade", "Position":[39, 7] }
]
}
CommaPadding
If true, includes a space after commas separating array items and object properties.
Example:
CommaPadding=true
{
"TeamId": 2,
"Placements": [
{ "UnitType": "Archer" , "Position": [41, 7] },
{ "UnitType": "Pikeman" , "Position": [40, 7] },
{ "UnitType": "Barricade", "Position": [39, 7] }
]
}
CommaPadding=false
{
"TeamId": 2,
"Placements": [
{ "UnitType": "Archer" ,"Position": [41,7] },
{ "UnitType": "Pikeman" ,"Position": [40,7] },
{ "UnitType": "Barricade","Position": [39,7] }
]
}
AlwaysExpandDepth
Depth at which lists/objects are always fully expanded, regardless of other settings. -1 = none; 0 = root node only; 1 = root node and its children; etc.
Example:
AlwaysExpandDepth=-1, MaxInlineLength=10000, MaxInlineComplexity=100, MaxCompactArrayComplexity=100
{ "AttackPlans": [ { "TeamId": 1, "Spawns": [ {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0}, {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0}, {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0} ] } ], "DefensePlans": [ { "TeamId": 2, "Placements": [ { "UnitType": "Archer", "Position": [41, 7] }, { "UnitType": "Pikeman", "Position": [40, 7] }, { "UnitType": "Barricade", "Position": [39, 7] } ] } ] }
AlwaysExpandDepth=0, MaxInlineLength=10000, MaxInlineComplexity=100, MaxCompactArrayComplexity=100
{
"AttackPlans" : [ { "TeamId": 1, "Spawns": [ {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0}, {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0}, {"Time": 0.0, "UnitType": "Grunt", "SpawnPointIndex": 0} ] } ],
"DefensePlans": [ { "TeamId": 2, "Placements": [ { "UnitType": "Archer", "Position": [41, 7] }, { "UnitType": "Pikeman", "Position": [40, 7] }, { "UnitType": "Barricade", "Position": [39, 7] } ] } ]
}
IndentSpaces
Sets the number of spaces per indent level.
UseTabToIndent
Instead of spaces, a tab character is used for each indent level.
TableObjectMinimumSimilarity
Value from 0 to 100 indicating how similar collections of inline objects need to be to be formatted as a table. A group of objects that don't have any property names in common has a similarity near zero. A group of objects that all contain the exact same property names has a similarity of 100. Setting this to a value >100 disables table formatting with objects as rows.
Example:
TableObjectMinimumSimilarity=75, MaxInlineLength=140
{
"ObjectColumnsObjectRows": {
"Vera" : { "street": "12 Madeup St." , "city": "Boston" , "state": "MA", "zip": "02127" },
"Chuck": { "street": "994 Fake Place", "unit": "102", "city": "Las Vegas", "state": "NV", "zip": "89102" },
"Dave" : { "street": "1967 Void Rd." , "unit": "B" , "city": "Athens" , "state": "GA" }
},
"ArrayColumnsObjectRows": [
{ "type": "turret" , "hp": 400, "loc": {"x": 47, "y": -4} , "flags": ["stationary"] },
{ "type": "assassin" , "hp": 80, "loc": {"x": 102, "y": 6} , "flags": ["stealth"] },
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
{ "type": "pittrap" , "loc": {"x": 10, "y": -14}, "flags": ["invulnerable", "stationary"] }
],
"DissimilarObjectRows": {
"lamp": {"x": 4, "y": 1002, "r": 75, "g": 0, "b": 130, "state": 1},
"address": {"city": "San Diego", "state": "CA"},
"font": {"r": 0, "g": 12, "b": 40, "size": 18, "style": "italic"}
}
}
TableObjectMinimumSimilarity=100, MaxInlineLength=140
{
"ObjectColumnsObjectRows": {
"Vera": {"street": "12 Madeup St.", "city": "Boston", "state": "MA", "zip": "02127"},
"Chuck": {"street": "994 Fake Place", "unit": "102", "city": "Las Vegas", "state": "NV", "zip": "89102"},
"Dave": {"street": "1967 Void Rd.", "unit": "B", "city": "Athens", "state": "GA"}
},
"ArrayColumnsObjectRows": [
{ "hp": 400, "type": "turret", "loc": {"x": 47, "y": -4}, "flags": ["stationary"] },
{ "type": "assassin", "hp": 80, "loc": {"x": 102, "y": 6}, "flags": ["stealth"] },
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
{ "loc": {"x": 10, "y": -14}, "type": "pittrap", "flags": ["invulnerable", "stationary"] }
],
"DissimilarObjectRows": {
"lamp": {"x": 4, "y": 1002, "r": 75, "g": 0, "b": 130, "state": 1},
"address": {"city": "San Diego", "state": "CA"},
"font": {"r": 0, "g": 12, "b": 40, "size": 18, "style": "italic"}
}
}
TableObjectMinimumSimilarity=0, MaxInlineLength=140
{
"ObjectColumnsObjectRows": {
"Vera" : { "street": "12 Madeup St." , "city": "Boston" , "state": "MA", "zip": "02127" },
"Chuck": { "street": "994 Fake Place", "unit": "102", "city": "Las Vegas", "state": "NV", "zip": "89102" },
"Dave" : { "street": "1967 Void Rd." , "unit": "B" , "city": "Athens" , "state": "GA" }
},
"ArrayColumnsObjectRows": [
{ "type": "turret" , "hp": 400, "loc": {"x": 47, "y": -4} , "flags": ["stationary"] },
{ "type": "assassin" , "hp": 80, "loc": {"x": 102, "y": 6} , "flags": ["stealth"] },
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
{ "type": "pittrap" , "loc": {"x": 10, "y": -14}, "flags": ["invulnerable", "stationary"] }
],
"DissimilarObjectRows": {
"lamp" : { "x": 4, "y": 1002, "r": 75, "g": 0, "b": 130, "state": 1 },
"address": { "city": "San Diego", "state": "CA" },
"font" : { "r": 0, "g": 12, "b": 40, "size": 18, "style": "italic" }
}
}
TableArrayMinimumSimilarity
Value from 0 to 100 indicating how similar collections of inline arrays need to be to be formatted as a table. Similarity for arrays refers to how similar they are in length; if they all have the same length their similarity is 100. Setting this to a value >100 disables table formatting with arrays as rows.
Example:
TableArrayMinimumSimilarity=75
{
"ObjectColumnsArrayRows": {
"Katherine": [ "blue" , "lightblue", "black" ],
"Logan" : [ "yellow" , "blue" , "black", "red" ],
"Erik" : [ "red" , "purple" ],
"Jean" : [ "lightgreen", "yellow" , "black" ]
},
"ArrayColumnsArrayRows": [
[ 0.0, 3.5, 10.50, 6.5, 2.50, 0.6 ],
[ 0.0, 0.0, 1.20, 2.1, 6.70, 4.4 ],
[ 0.4, 1.9, 4.40, 5.4, 2.35, 2.0 ],
[ 7.4, 1.2, 0.01, 0.0, 2.91, 0.2 ]
],
"DissimilarArrayRows": {
"primes": [2, 3, 5, 7, 11],
"powersOf2": [1, 2, 4, 8, 16, 32, 64, 128, 256],
"factorsOf12": [2, 2, 3],
"someZeros": [0, 0, 0, 0]
}
}
TableArrayMinimumSimilarity=100
{
"ObjectColumnsArrayRows": {
"Katherine": ["blue", "lightblue", "black"],
"Logan": ["yellow", "blue", "black", "red"],
"Erik": ["red", "purple"],
"Jean": ["lightgreen", "yellow", "black"]
},
"ArrayColumnsArrayRows": [
[ 0.0, 3.5, 10.50, 6.5, 2.50, 0.6 ],
[ 0.0, 0.0, 1.20, 2.1, 6.70, 4.4 ],
[ 0.4, 1.9, 4.40, 5.4, 2.35, 2.0 ],
[ 7.4, 1.2, 0.01, 0.0, 2.91, 0.2 ]
],
"DissimilarArrayRows": {
"primes": [2, 3, 5, 7, 11],
"powersOf2": [1, 2, 4, 8, 16, 32, 64, 128, 256],
"factorsOf12": [2, 2, 3],
"someZeros": [0, 0, 0, 0]
}
}
TableArrayMinimumSimilarity=0
{
"ObjectColumnsArrayRows": {
"Katherine": [ "blue" , "lightblue", "black" ],
"Logan" : [ "yellow" , "blue" , "black", "red" ],
"Erik" : [ "red" , "purple" ],
"Jean" : [ "lightgreen", "yellow" , "black" ]
},
"ArrayColumnsArrayRows": [
[ 0.0, 3.5, 10.50, 6.5, 2.50, 0.6 ],
[ 0.0, 0.0, 1.20, 2.1, 6.70, 4.4 ],
[ 0.4, 1.9, 4.40, 5.4, 2.35, 2.0 ],
[ 7.4, 1.2, 0.01, 0.0, 2.91, 0.2 ]
],
"DissimilarArrayRows": {
"primes" : [ 2, 3, 5, 7, 11 ],
"powersOf2" : [ 1, 2, 4, 8, 16, 32, 64, 128, 256 ],
"factorsOf12": [ 2, 2, 3 ],
"someZeros" : [ 0, 0, 0, 0 ]
}
}
AlignExpandedPropertyNames
If true, property names of expanded objects are padded to the same size.
Example:
AlignExpandedPropertyNames=false
{
"lamp": {"x": 4, "y": 1002, "r": 75, "g": 0, "b": 130, "state": 1},
"address": {"city": "San Diego", "state": "CA"},
"font": {"r": 0, "g": 12, "b": 40, "size": 18, "style": "italic"}
}
AlignExpandedPropertyNames=true
{
"lamp" : {"x": 4, "y": 1002, "r": 75, "g": 0, "b": 130, "state": 1},
"address": {"city": "San Diego", "state": "CA"},
"font" : {"r": 0, "g": 12, "b": 40, "size": 18, "style": "italic"}
}
DontJustifyNumbers
If true, numbers won't be right-aligned with matching precision.
Example:
DontJustifyNumbers=false
[
[ 0.0, 3.5, 10.50, 6.5, 2.50, 0.6 ],
[ 0.0, 0.0, 1.20, 2.1, 6.70, 4.4 ],
[ 0.4, 1.9, 4.40, 5.4, 2.35, 2.0 ],
[ 7.4, 1.2, 0.01, 0.0, 2.91, 0.2 ]
]
DontJustifyNumbers=true
[
[ 0 , 3.5, 10.5 , 6.5, 2.5 , 0.6 ],
[ 0 , 0 , 1.2 , 2.1, 6.7 , 4.4 ],
[ 0.4, 1.9, 4.4 , 5.4, 2.35, 2.0 ],
[ 7.4, 1.2, 0.01 , 0 , 2.91, 0.2 ]
]
PrefixString
String attached to the beginning of every line, before regular indentation.
Example:
PrefixString=""
[
{
"TeamId": 2,
"Placements": [
{ "UnitType": "Archer" , "Position": [41, 7] },
{ "UnitType": "Pikeman" , "Position": [40, 7] },
{ "UnitType": "Barricade", "Position": [39, 7] }
]
}
]
PrefixString="// "
// [
// {
// "TeamId": 2,
// "Placements": [
// { "UnitType": "Archer" , "Position": [41, 7] },
// { "UnitType": "Pikeman" , "Position": [40, 7] },
// { "UnitType": "Barricade", "Position": [39, 7] }
// ]
// }
// ]
StringWidthFunc
Function that returns the visual width of strings measured in spaces. This is used to line columns up when formatting objects/arrays as tables. You can use the static methods StringWidthByCharacterCount, StringWidthWithEastAsian, or supply your own.
Note that this is only helpful if your font ensures the proper relationship of character sizes.
StringWidthFunc=Formatter.StringWidthWithEastAsian
[
{ "field1": "foobar", "field2": "あいうえお", "field3": 1 },
{ "field1": "foo" , "field2": "あいうえ" , "field3": 10 },
{ "field1": "bara" , "field2": "あいう" , "field3": 100 }
]
StringWidthFunc=Formatter.StringWidthByCharacterCount
[
{ "field1": "foobar", "field2": "あいうえお", "field3": 1 },
{ "field1": "foo" , "field2": "あいうえ" , "field3": 10 },
{ "field1": "bara" , "field2": "あいう" , "field3": 100 }
]