|
148 | 148 | `chars; |
149 | 149 | .axq.i_NONPRIMCODE type data]; |
150 | 150 | values: ('[removeTrailingNewline; toString] each data); |
| 151 | + values: $[type values = 11h; enlist values; values]; |
151 | 152 | order: $[1 ~ count data; iasc enlist data; iasc data]; |
152 | 153 | returnDictionary: `name`type`values`order!(name;types;values;order); |
153 | 154 | if[isKey; returnDictionary[`isKey]: isKey]; |
|
172 | 173 | (generateColumns[::;0b;1b;key data;"key"]; generateColumns[::;0b;0b;value data;"values"]); |
173 | 174 | isTable; |
174 | 175 | generateTableColumns[originalType;isAtom;0b;data]; |
| 176 | + generateColumns[originalType;isAtom;0b;data;$[isAtom;"value";"values"]] |
175 | 177 | ]; |
176 | 178 | : .j.j `count`columns!(quantity; columns) |
177 | 179 | }[generateTableColumns; generateColumns]; |
|
192 | 194 | fn[sampleSize; data] |
193 | 195 | } |
194 | 196 | result: evalInContext[ctx; splitExpression stripTrailingSemi wrapLines removeMultilineComments code]; |
195 | | - if[result `errored; :result]; |
| 197 | + if [result `errored; :result]; |
| 198 | + /ggplot - start |
196 | 199 | if[type[result[`result]] = 99h; |
197 | | - if[`output in key result[`result]; |
198 | | - if[type[result[`result][`output]] = 99h; |
199 | | - if[`bytes in key result[`result][`output]; |
200 | | - result[`base64]:1b; result[`result]: .Q.btoa result[`result][`output][`bytes]; :result]]]]; |
| 200 | + attrs: key[[result[`result]]]; |
| 201 | + if[type[attrs] = 11h; |
| 202 | + if[`output in attrs; |
| 203 | + output: result[`result][`output]; |
| 204 | + if[type[output] = 99h; |
| 205 | + attrs: key[output]; |
| 206 | + if[type[attrs] = 11h; |
| 207 | + if[`bytes in attrs; |
| 208 | + bytes: output[`bytes]; |
| 209 | + if[type[bytes] = 4h; |
| 210 | + if[0x89504E470D0A1A0A ~ bytes til 8; |
| 211 | + result[`base64]: 1b; |
| 212 | + result[`result]: .Q.btoa bytes; |
| 213 | + :result]]]]]]]]; |
| 214 | + /ggplot - end |
201 | 215 | if [returnFormat ~ "text"; |
202 | 216 | result[`result]: toString result `result]; |
203 | 217 | if [returnFormat ~ "structuredText"; |
|
0 commit comments