1+ {
2+ "$schema" : " https://vega.github.io/schema/vega-lite/v5.json" ,
3+
4+ "description" : " Vertically concatanated graphs, select point on lower graph to highlight Technology on price graph above" ,
5+
6+ "data" : {"url" : " https://raw.githubusercontent.com/jhellingsdata/jhellingsdata.github.io/main/Project/Data/SolCost_IRENA.csv" },
7+ "config" : {
8+ "view" : {"stroke" : " transparent" }
9+ },
10+ "title" : {
11+ "text" : " Costs of renewables, 10 years of progress" ,
12+ "color" : " #54bb8e" ,
13+ "fontSize" : 14 ,
14+ "anchor" : " start" ,
15+ "subtitle" : " Global LCOE 2020$/kWh, source: IRENA" ,
16+ "subtitleFontStyle" : " italic" ,
17+ "subtitleFontSize" : 11 ,
18+ "frame" : " group"
19+ },
20+
21+ "vconcat" : [
22+ {
23+ "name" : " top" ,
24+ "height" : 200 ,
25+ "width" : 330 ,
26+ "mark" : {
27+ "type" : " line" ,
28+ "point" : " transparent"
29+ },
30+ "encoding" : {
31+ "color" : {
32+ "field" : " Technology" ,
33+ "legend" : {
34+ "orient" : " none" ,
35+ "legendX" : 250 ,
36+ "legendY" : 5 ,
37+ "title" : null ,
38+ "symbolSize" : 40
39+ },
40+ "type" : " nominal" ,
41+ "scale" : {
42+ "domain" : [" Bioenergy" , " Geothermal" , " Hydropower" , " Offshore wind" , " Onshore wind" , " Solar concentrating" , " Solar photovoltaic" ],
43+ "range" : [" #009642" , " #E86200" , " #00A9E8" , " #5B5E76" , " #B5D37E" , " #AA649E" , " #F7B913" ]
44+ }
45+ },
46+ "x" : {
47+ "field" : " Year" ,
48+ "type" : " temporal" ,
49+ "title" : null ,
50+ "axis" : {
51+ "grid" : false
52+ }
53+ },
54+
55+ "y" : {
56+ "field" : " Weighted average" ,
57+ "type" : " quantitative" ,
58+ "title" : null
59+ },
60+ "tooltip" : [
61+ {"field" : " Technology" },
62+ {"field" : " LCOE" }
63+ ]
64+ },
65+
66+ "transform" : [
67+ {"calculate" : " datum['Weighted average'] + ' $/kWh'" , "as" : " LCOE" }
68+ ]
69+ },
70+
71+ {
72+ "height" : 150 ,
73+ "width" : 330 ,
74+ "name" : " bottom" ,
75+ "title" : {
76+ "text" : " Yearly change in global capcity" ,
77+ "anchor" : " start" ,
78+ "fontSize" : 12 ,
79+ "frame" : " group"
80+ },
81+ "transform" : [
82+ {"calculate" : " format(datum['Net additions MW'], ',') + ' MW'" , "as" : " Net additions" }
83+ ],
84+ "mark" : {
85+ "type" : " point" ,
86+ "filled" : true ,
87+ "size" : 150
88+ },
89+ "encoding" : {
90+ "color" : {
91+ "field" : " Technology" ,
92+ "type" : " ordinal"
93+ },
94+
95+ "x" : {
96+ "field" : " Year" ,
97+ "type" : " temporal" ,
98+ "title" : null ,
99+ "axis" : {
100+ "grid" : false
101+ }
102+ },
103+ "y" : {
104+ "field" : " Net additions MW" ,
105+ "type" : " quantitative" ,
106+ "title" : null ,
107+ "axis" : {
108+ "labelExpr" : " (datum.value / 1000) + 'GW'"
109+ }
110+ },
111+ "tooltip" : [
112+ {"field" : " Technology" },
113+ {"field" : " Net additions" }
114+ ]
115+ }
116+ }
117+ ]
118+ }
0 commit comments