You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up in our chat – I think it's a good idea.
Could look something like this:
classVegalite(object):
def__init__(self, spec):
try:
spec=json.loads(spec)
exceptTypeError:
passif'data'notinspec:
raiseKeyError('No data provided with spec')
self.spec=utils.update(spec, DEFAULTS, overwrite=False)
Advantage is more flexible API & ability to out-source dataframe formatting stuff to Pandas; the disadvantage is that in some situations we'd add an extra string->dict->string cycle.
The text was updated successfully, but these errors were encountered:
Related question: are there any situations in which a valid Vega/Vegalite JSON string would be broken through doing spec = json.dumps(json.loads(spec))?
Related question: are there any situations in which a valid Vega/Vegalite JSON string would be broken through doing spec = json.dumps(json.loads(spec))?
I can't think of anything that could cause issues.
Another idea: I think it would make sense to let the Vegalite class take an optional data argument, that it would then roll into the dict/string spec (rather than having that part in an external function).
This came up in our chat – I think it's a good idea.
Could look something like this:
Advantage is more flexible API & ability to out-source dataframe formatting stuff to Pandas; the disadvantage is that in some situations we'd add an extra string->dict->string cycle.
The text was updated successfully, but these errors were encountered: