I would like to print a JSON structure which includes nicely formed matrices. The goal is for data to be human-readable. Ideally, the dictionary Dict("matrix" => [1 2 3;4 5 6;7 8 9])
would be printed like,
{
"matrix" : [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
}
The default behavior of JSON.jl (using indentations), is to place a newline after every comma in the matrix. This ends up being hard to read data.
Is there a way to customize JSON.Writer.StructuralContext
to achieve the desired result?