{"id":415,"date":"2020-06-05T21:37:24","date_gmt":"2020-06-05T08:37:24","guid":{"rendered":"https:\/\/blog.wiseowls.co.nz\/?p=415"},"modified":"2026-03-08T00:44:44","modified_gmt":"2026-03-07T11:44:44","slug":"data-visualisation-with-vega","status":"publish","type":"post","link":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/","title":{"rendered":"Data visualisation with Vega"},"content":{"rendered":"\n<p>We love nice dashboards. And if you see a chart somewhere on a webpage &#8211; chances are it runs <a href=\"https:\/\/d3js.org\/\">D3.js<\/a>. D3.js is a JavaScript library for manipulating documents based on data. It allows you to do a great deal of visualisation but comes with a bit of a learning curve. Even though the data can come in any shape and form, plotting and transformations are JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Declarative approach<\/h2>\n\n\n\n<p>This is where <a href=\"https:\/\/vega.github.io\/vega\/about\/\">Vega<\/a> comes forward. Everything is now a JSON therefore we can literally build and ship visualisations without touching JavaScript at all!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step by step<\/h2>\n\n\n\n<p>Suppose we&#8217;ve got hierarchical animal data represented by following JSON:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">\"values\": [\n        {\"id\": \"1\", \"parent\": null, \"title\": \"Animal\"},\n        {\"id\": \"2\", \"parent\": \"1\", \"title\": \"Duck\"},\n        {\"id\": \"3\", \"parent\": \"1\", \"title\": \"Fish\"},\n        {\"id\": \"4\", \"parent\": \"1\", \"title\": \"Zebra\"}\n      ]<\/code><\/pre>\n\n\n\n<p>What we can then do is to lay the nodes out in a tree-like shape (<a href=\"https:\/\/vega.github.io\/vega\/docs\/transforms\/stratify\/\"><code>stratify<\/code><\/a>&nbsp;does the job):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">\"transform\": [\n        {\n          \"type\": \"stratify\",\n          \"key\": \"id\",\n          \"parentKey\": \"parent\"\n        },\n        {\n          \"type\": \"tree\",\n          \"method\": \"tidy\",\n          \"separation\": true,\n          \"size\": [{\"signal\": \"width\"}, {\"signal\": \"height\"}]\n        }\n      ]<\/code><\/pre>\n\n\n\n<p>having laid out the nodes, we need to generate connecting lines,&nbsp;<a href=\"https:\/\/vega.github.io\/vega\/docs\/transforms\/treelinks\/\"><code>treelinks<\/code><\/a>&nbsp;+&nbsp;<a href=\"http:\/\/%60treelinks%60\/\"><code>linkpath<\/code><\/a>&nbsp;combo does exactly that:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n      \"name\": \"links\",\n      \"source\": \"tree\", \/\/ take datasource \"tree\" as input\n      \"transform\": [\n        { \"type\": \"treelinks\" }, \/\/ apply transform 1\n        { \"type\": \"linkpath\", \/\/ follow up with next transform\n          \"shape\": \"diagonal\"\n          }\n      ]\n    }<\/code><\/pre>\n\n\n\n<p>now that we&#8217;ve got our data sources, we want to draw actual objects. In Vega these are called&nbsp;<code>marks<\/code>. For simplicity I&#8217;m only drawing one rectangle with a title for each data point and some basic lines to connect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">\"marks\": [\n    {\n      \"type\": \"path\",\n      \"from\": {\"data\": \"links\"}, \/\/ dataset we defined above\n      \"encode\": {\n        \"enter\": {\n          \"path\": {\"field\": \"path\"} \/\/ linkpath generated a dataset with \"path\" field in it - we just grab it here\n        }\n      }\n    },\n    {\n      \"type\": \"rect\",\n      \"from\": {\"data\": \"tree\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    },\n    {\n      \"type\": \"text\",\n      \"from\": {\"data\": \"tree\"}, \/\/ use data set we defined earlier\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"text\": {\"field\": \"title\"}, \/\/ we can use data fields to display actual values\n          \"x\": {\"field\": \"x\"}, \/\/ use data fields to draw values from\n          \"y\": {\"field\": \"y\"},\n          \"dx\": {\"value\":50}, \/\/ offset the mark to appear in rectangle center\n          \"dy\": {\"value\":13},\n          \"align\": {\"value\": \"center\"}\n        }\n      }\n    }\n  ]<\/code><\/pre>\n\n\n\n<p>All in all we&nbsp;arrived at a very basic hierarchical chart. It looks kinda plain and can definitely be improved: the rectangles there should probably be replaced with&nbsp;<a href=\"https:\/\/vega.github.io\/vega\/docs\/marks\/group\/\"><code>groups<\/code><\/a>&nbsp;and connection paths will need some work too.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n  \"$schema\": \"https:\/\/vega.github.io\/schema\/vega\/v5.json\",\n  \"width\": 800,\n  \"height\": 300,\n  \"padding\": 5,\n\n  \"data\": [\n    {\n      \"name\": \"tree\",\n      \"values\": [\n        {\"id\": \"1\", \"parent\": null, \"title\": \"Animal\"},\n        {\"id\": \"2\", \"parent\": \"1\", \"title\": \"Duck\"},\n        {\"id\": \"3\", \"parent\": \"1\", \"title\": \"Fish\"},\n        {\"id\": \"4\", \"parent\": \"1\", \"title\": \"Zebra\"}\n      ],\n      \"transform\": [\n        {\n          \"type\": \"stratify\",\n          \"key\": \"id\",\n          \"parentKey\": \"parent\"\n        },\n        {\n          \"type\": \"tree\",\n          \"method\": \"tidy\",\n          \"separation\": true,\n          \"size\": [{\"signal\": \"width\"}, {\"signal\": \"height\"}]\n        }\n      ]      \n    },\n    {\n      \"name\": \"links\",\n      \"source\": \"tree\",\n      \"transform\": [\n        { \"type\": \"treelinks\" },\n        { \"type\": \"linkpath\",\n          \"shape\": \"diagonal\"\n          }\n      ]\n    }, \n    {\n      \"name\": \"tree-boxes\",\n      \"source\": \"tree\",\n      \"transform\": [\n          { \n            \"type\": \"filter\",\n            \"expr\": \"datum.parent == null\"\n          }\n        ]\n    },\n    {\n      \"name\": \"tree-circles\",\n      \"source\": \"tree\",\n      \"transform\": [\n        {\n          \"type\": \"filter\",\n          \"expr\": \"datum.parent != null\"\n        }\n      ]\n    }\n  ],\n  \"marks\": [\n    {\n      \"type\": \"path\",\n      \"from\": {\"data\": \"links\"},\n      \"encode\": {\n        \"enter\": {\n          \"path\": {\"field\": \"path\"}\n        }\n      }\n    },\n    {\n      \"type\": \"rect\",\n      \"from\": {\"data\": \"tree-boxes\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    },\n    {\n      \"type\": \"symbol\",\n      \"from\": {\"data\": \"tree-circles\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    },\n    {\n      \"type\": \"rect\",\n      \"from\": {\"data\": \"tree\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    },\n    {\n      \"type\": \"text\",\n      \"from\": {\"data\": \"tree\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"text\": {\"field\": \"title\"},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"},\n          \"dx\": {\"value\":50},\n          \"dy\": {\"value\":13},\n          \"align\": {\"value\": \"center\"}\n        }\n      }\n    }\n  ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Getting a bit fancier<\/h2>\n\n\n\n<p>Suppose, we would like to render different shapes for root and leaf nodes of our chart. One way to achieve this will be to add two&nbsp;<a href=\"https:\/\/vega.github.io\/vega\/docs\/transforms\/filter\/\"><code>filter<\/code><\/a>&nbsp;transformations based on your&nbsp;<code>tree<\/code>&nbsp;dataset and filter them accordingly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">    {\n      \"name\": \"tree-boxes\",\n      \"source\": \"tree\", \/\/ grab the existing data\n      \"transform\": [\n          { \n            \"type\": \"filter\",\n            \"expr\": \"datum.parent == null\" \/\/ run it through a filter defined by expression\n          }\n        ]\n    },\n    {\n      \"name\": \"tree-circles\",\n      \"source\": \"tree\",\n      \"transform\": [\n        {\n          \"type\": \"filter\",\n          \"expr\": \"datum.parent != null\"\n        }\n      ]\n    }<\/code><\/pre>\n\n\n\n<p>then instead of rendering all marks as&nbsp;<code>rect<\/code>&nbsp;we&#8217;d want two different shapes for respective transformed datasets:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n      \"type\": \"rect\",\n      \"from\": {\"data\": \"tree-boxes\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    },\n    {\n      \"type\": \"symbol\",\n      \"from\": {\"data\": \"tree-circles\"},\n      \"encode\": {\n        \"enter\": {\n          \"stroke\": {\"value\": \"black\"},\n          \"width\": {\"value\": 100},\n          \"height\": {\"value\": 20},\n          \"x\": {\"field\": \"x\"},\n          \"y\": {\"field\": \"y\"}\n        }\n      }\n    }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Demo time<\/h2>\n\n\n\n<p>Play with Vega in live editor <a rel=\"noreferrer noopener\" href=\"https:\/\/vega.github.io\/editor\/#\/url\/vega\/N4KABGBEAkDODGALApgWwIaQFxUQFzwAdYsB6UgN2QHN0A6agSz0QFcAjOxge1IRQyUa6SgFY6AK1jcAdpAA04KAHdGAExbYwADgAMuxREgpG1fFoDM+w1ELo1axjOpbRipZDXo8mHAG0lCFAIEKgZdFRkLUg8ACdkKJtQyAp0ABtWZFgtANDQ4Eh1aIBGBVt0eJk8LRlWNLT5KDxmNKicSABBGUYMNMgAXyS8gqL2gCYyyDtK6vbSxpiWtqgAEVZ4AGsBofzCtWiLSenkKpLJ5rxW6IAxRlhEbcDhveiAFiOKk9moeaal6IAWsh2LFMP0nhAALo7JqgmSwABm3FiqByEJCwTyyTwAE9CMtILA4t5GAicQp0ckNshye0ijDkscqgBpGnRJnVSlgQZczFYoy4-HROIJCn8kKQSIsbj7drNNTkhkS2DIaYk2RaOKZJVGWCMABeyz8BT11HCfXaqg0D0GYBNpnN0RMZmq-UhXPBWMhWKePPy6Mg4Ui0TSTg22RhhO4rFi8AJIsSAeJ8KRKLR4uATTx8fiyFDMnDkG5SszMWzIbDdk0Oqg93QQvajnQ1Fk6UgXIgnry7tCtqefIlQZzCQAtOxuAAPLJivJRmNx4W5mfYuGI5Go-wdu1gLcC8vtBGMNJ4ZCxZfiqDICeEM+N7ysVB0DlgAC8L7AtXq7Yv3K5PZCfoYgGQ6LqO8CMLGrQRgG0jzsOiZYjEq6phuYC5PyA6IYKBKHsep7nohV43tEXh4A+T6fFUYAAITvp+fQeui-6dko0IeBgsSFpu-pYfu5TVgGCKxNwqEFKRvhQPmhaAckJzwDKyyYRKXz4TgSmMt4DxqZAh55rK-E2oxWJdp2QxKWWDZQPE8DVJGQkiVoYneBJSGjuOU7ZDJykyPJaiKVykAqbedpboScTcNSjkpOkmTROwaToJsjw-pAVqaNpqQZMsxT6F5iHOuYGUxcsYy6Hls4TlFulpPpkCVeVyS0naOmMHp0TkiZeSdSxvZmUmfGEjiqDjn0dnCaJnjOaByAjuBkHTuVgU+QpjkBUFq0pUSwmRUVWVxQlSUNRKaVac1mWxTgOVlTWxjIKYhVncVWilUdRiVdp1W1fVN1NQUn3tQMRldb6fW8ZZkDWbZgnjVF4nTcls5yStalrVUqkhZt4U7Y9e3tPFiVbK9KjqOlOMXWAV1E7d93fAU50lddoXvc1-3tN9oW-S1bXtB1QO9iD-b9eDJ4TlDiH2RNcNykui1I35G38ktJ7BepypY4p0W41A+OHTdIu01zNXCv8VPM39rVG2zCPipAnOs1AHU3WoZuaxdoiMylCpRfT2DFBYVPpA63tPe0cZo2e3UAeinVdu6-RAA\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We love nice dashboards. And if you see a chart somewhere on a webpage &#8211; chances are it runs D3.js. D3.js is a JavaScript library for manipulating documents based on data. It allows you to do a great deal of visualisation but comes with a bit of a learning curve. Even though the data can &hellip; <a href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Data visualisation with Vega&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[11],"tags":[42],"class_list":["post-415","post","type-post","status-publish","format-standard","hentry","category-dev","tag-d3-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data visualisation with Vega - Timur and associates<\/title>\n<meta name=\"description\" content=\"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data visualisation with Vega - Timur and associates\" \/>\n<meta property=\"og:description\" content=\"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/\" \/>\n<meta property=\"og:site_name\" content=\"Timur and associates\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-05T08:37:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-07T11:44:44+00:00\" \/>\n<meta name=\"author\" content=\"timur\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TimurKh\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/\"},\"author\":{\"name\":\"timur\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"headline\":\"Data visualisation with Vega\",\"datePublished\":\"2020-06-05T08:37:24+00:00\",\"dateModified\":\"2026-03-07T11:44:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/\"},\"wordCount\":297,\"keywords\":[\"d3.js\"],\"articleSection\":[\"Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/\",\"name\":\"Data visualisation with Vega - Timur and associates\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\"},\"datePublished\":\"2020-06-05T08:37:24+00:00\",\"dateModified\":\"2026-03-07T11:44:44+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"description\":\"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2020\\\/06\\\/05\\\/data-visualisation-with-vega\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data visualisation with Vega\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\",\"name\":\"Timur and associates\",\"description\":\"Notes of an IT contractor\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\",\"name\":\"timur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"caption\":\"timur\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/TimurKh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data visualisation with Vega - Timur and associates","description":"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/","og_locale":"en_US","og_type":"article","og_title":"Data visualisation with Vega - Timur and associates","og_description":"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.","og_url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/","og_site_name":"Timur and associates","article_published_time":"2020-06-05T08:37:24+00:00","article_modified_time":"2026-03-07T11:44:44+00:00","author":"timur","twitter_card":"summary_large_image","twitter_creator":"@TimurKh","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/#article","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/"},"author":{"name":"timur","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"headline":"Data visualisation with Vega","datePublished":"2020-06-05T08:37:24+00:00","dateModified":"2026-03-07T11:44:44+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/"},"wordCount":297,"keywords":["d3.js"],"articleSection":["Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/","url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/","name":"Data visualisation with Vega - Timur and associates","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/#website"},"datePublished":"2020-06-05T08:37:24+00:00","dateModified":"2026-03-07T11:44:44+00:00","author":{"@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"description":"Replacing D3.js with Vega for declarative data visualisation. Everything is JSON, no JavaScript required.","breadcrumb":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2020\/06\/05\/data-visualisation-with-vega\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.wiseowls.co.nz\/"},{"@type":"ListItem","position":2,"name":"Data visualisation with Vega"}]},{"@type":"WebSite","@id":"https:\/\/blog.wiseowls.co.nz\/#website","url":"https:\/\/blog.wiseowls.co.nz\/","name":"Timur and associates","description":"Notes of an IT contractor","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.wiseowls.co.nz\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59","name":"timur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","caption":"timur"},"sameAs":["https:\/\/x.com\/TimurKh"]}]}},"_links":{"self":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":7,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/415\/revisions"}],"predecessor-version":[{"id":543,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/415\/revisions\/543"}],"wp:attachment":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/categories?post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/tags?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}