// bar-chart.vg.json from https://gist.github.com/hadim/629b8fde56eac74c587136139a0dd5c2#file-bar-chart-vg-json import com.twosigma.beakerx.mimetype.MIMEContainer import groovy.json.JsonSlurper fname = "../resources/bar-chart.vg.json" fileContents = new File(fname).text def jsonSlurper = new JsonSlurper() def json = jsonSlurper.parseText(fileContents) new MIMEContainer("application/vnd.vega.v2+json", json)