Hi,
We are using Vega to create dynamic charts from Sci-Kit learn results. Most results return a 1D or 2D array, what's getting me is some results return a single key and value.
Example:
[
"label": 'nSampleSeen', "value": '572",
"label": 'nComponents', "value": '3",
"label": 'Noise Variance', "value": '0.17"
]
This array is returned as values and passed to data, the values are too varied to chart so the solution was to put them in a printed text table. Iv'e tried several ways to get the text to line up
nSampleSeen: 572
nComponents: 3
Noise Variance: 0.17
Any suggestion as to how to group the label/value text marks to they print as above? Clearly, in the block below the values print over themselves because they do not have defined coordinates, wonder the best way to do this (mark group, signals)? I'm fairly new to Vega but this might be so obvious that I'm missing the "duh" moment. Any help would be amazing. Thanks!
const vega = {
‘title’: {
‘font’: ‘Lato’,
‘offset’: 10,
‘fontSize’: 8
},
‘width’: 185,
‘height’: 250,
‘padding’: 0,
‘autosize’: { ‘type’: ‘fit’, ‘resize’: true },
‘data’: [
{
‘name’: ‘table’,
‘values’: values,
}
],
‘marks’: [
{
‘type’: ‘text’,
‘from’: {
‘data’: ‘table’
},
‘encode’: {
‘enter’: {
‘align’: {
‘value’: ‘center’
},
‘text’: {
‘field’: ‘value’
},
‘font’: {
‘value’: ‘Lato’
},
‘fontSize’: {
‘value’: 10
},
}
}
}
]
};
return vega;