Skip to content

Instantly share code, notes, and snippets.

@dechamps
Created June 28, 2020 16:34
Show Gist options
  • Save dechamps/3c8ed44638e65d53758e2def67b657b4 to your computer and use it in GitHub Desktop.
Save dechamps/3c8ed44638e65d53758e2def67b657b4 to your computer and use it in GitHub Desktop.
Vega-Lite spec from Sun Jun 28 2020
{
"config": {
"view": {"continuousWidth": 400, "continuousHeight": 300, "opacity": 0}
},
"vconcat": [
{
"data": {"name": "data-9a3bc27729824677a04f57dcb5a098d3"},
"facet": {"type": "nominal", "field": "speaker", "title": null},
"spec": {
"layer": [
{
"layer": [
{
"mark": {
"type": "line",
"clip": true,
"interpolate": "monotone"
},
"encoding": {
"opacity": {
"condition": {"value": 1, "selection": "selector004"},
"value": 0.2
}
},
"selection": {
"selector004": {
"type": "multi",
"encodings": ["color"],
"bind": "legend"
},
"selector009": {
"type": "interval",
"bind": "scales",
"encodings": ["x", "y"]
}
}
},
{
"mark": {"type": "circle", "clip": true, "size": 100},
"encoding": {
"fillOpacity": {
"condition": {"value": 0.3, "selection": "selector005"},
"value": 0
}
},
"selection": {
"selector005": {
"type": "single",
"on": "mouseover",
"clear": "mouseout",
"empty": "none",
"encodings": ["x", "y"]
}
}
}
],
"encoding": {
"y": {
"type": "quantitative",
"axis": {"grid": true},
"field": "value",
"scale": {"domain": [-40, 10]},
"title": ["Relative Sound Pressure (dBr)"]
}
},
"transform": [
{
"filter": {
"field": "key",
"oneOf": [
"On Axis",
"Listening Window",
"Early Reflections",
"Sound Power"
]
}
}
]
},
{
"layer": [
{
"mark": {
"type": "line",
"clip": true,
"interpolate": "monotone"
},
"encoding": {
"opacity": {
"condition": {"value": 1, "selection": "selector006"},
"value": 0.2
}
},
"selection": {
"selector006": {
"type": "multi",
"encodings": ["color"],
"bind": "legend"
},
"selector008": {
"type": "interval",
"bind": "scales",
"encodings": ["x", "y"]
}
}
},
{
"mark": {"type": "circle", "clip": true, "size": 100},
"encoding": {
"fillOpacity": {
"condition": {"value": 0.3, "selection": "selector007"},
"value": 0
}
},
"selection": {
"selector007": {
"type": "single",
"on": "mouseover",
"clear": "mouseout",
"empty": "none",
"encodings": ["x", "y"]
}
}
}
],
"encoding": {
"y": {
"type": "quantitative",
"axis": {"grid": true},
"field": "value",
"scale": {"domain": [-10, 40]},
"title": ["Directivity Index (dBr)"]
}
},
"transform": [
{
"filter": {
"field": "key",
"oneOf": ["Early Reflections DI", "Sound Power DI"]
}
}
]
}
],
"encoding": {
"color": {
"type": "nominal",
"field": "key",
"legend": {"symbolType": "stroke"},
"sort": null,
"title": null
},
"tooltip": [
{"type": "nominal", "field": "key", "title": "Response"},
{
"type": "quantitative",
"field": "frequency",
"format": ".03s",
"title": "Frequency (Hz)"
},
{
"type": "quantitative",
"field": "value",
"format": ".2f",
"title": "Value (dB)"
}
],
"x": {
"type": "quantitative",
"axis": {"format": "s"},
"field": "frequency",
"scale": {
"base": 10,
"domain": [20, 20000],
"nice": false,
"type": "log"
},
"title": "Frequency (Hz)"
}
},
"height": 400,
"resolve": {"scale": {"y": "independent"}},
"transform": [
{
"flatten": [
"frequency",
"On Axis",
"Listening Window",
"Early Reflections",
"Sound Power",
"Early Reflections DI",
"Sound Power DI"
]
},
{
"fold": [
"On Axis",
"Listening Window",
"Early Reflections",
"Sound Power",
"Early Reflections DI",
"Sound Power DI"
]
}
],
"width": 800
},
"resolve": {"scale": {"y": "independent"}}
},
{
"mark": "text",
"height": 1,
"title": {
"text": [
"Smoothing: None",
"Mean resolution: 19.5 pts/octave",
"Data License: Creative Commons BY-NC-SA 4.0",
"Data: amirm, AudioScienceReview.com - Plotted by Loudspeaker Explorer"
],
"anchor": "start",
"color": "gray",
"fontSize": 10,
"fontWeight": "lighter"
},
"width": 600
}
],
"resolve": {"legend": {"color": "independent"}},
"$schema": "https://vega.github.io/schema/vega-lite/v4.8.1.json",
"datasets": {
"data-9a3bc27729824677a04f57dcb5a098d3": [
{
"speaker": "Infinity IL10",
"frequency": [
20.508,
21.973,
23.438,
24.902,
26.367,
27.832,
29.297,
30.762,
32.227,
33.691,
35.156,
36.621,
38.086,
39.551,
41.016,
42.48,
43.945,
45.41,
46.875,
48.34,
51.27,
52.734,
54.199,
55.664,
58.594,
60.059,
62.988,
64.453,
67.383,
68.848,
71.777,
74.707,
77.637,
79.102,
82.031,
84.961,
87.891,
90.82,
95.215,
98.144,
101.074,
105.469,
108.398,
112.793,
117.188,
120.117,
124.512,
128.906,
133.301,
139.16,
143.555,
147.949,
153.809,
159.668,
165.527,
171.387,
177.246,
183.105,
188.965,
196.289,
203.613,
210.938,
218.262,
225.586,
232.91,
241.699,
250.488,
259.277,
268.066,
276.855,
287.109,
297.363,
307.617,
319.336,
329.59,
341.309,
353.027,
366.211,
379.395,
392.578,
405.762,
420.41,
435.059,
451.172,
465.82,
483.398,
499.512,
517.09,
536.133,
555.176,
574.219,
594.727,
615.234,
637.207,
659.18,
682.617,
707.52,
732.422,
757.324,
785.156,
811.523,
840.82,
870.117,
900.879,
933.105,
965.332,
1000.49,
1035.64,
1072.27,
1108.89,
1148.44,
1189.45,
1230.47,
1274.41,
1319.82,
1366.7,
1413.57,
1463.38,
1516.11,
1568.85,
1624.51,
1681.64,
1741.7,
1803.22,
1866.21,
1932.13,
1999.51,
2069.82,
2143.07,
2219.24,
2296.88,
2378.91,
2462.4,
2548.83,
2639.65,
2731.93,
2828.61,
2928.22,
3030.76,
3137.7,
3249.02,
3363.28,
3481.93,
3604.98,
3732.42,
3864.26,
4000.49,
4141.11,
4287.6,
4438.48,
4595.21,
4756.35,
4924.8,
5097.66,
5277.83,
5463.87,
5657.23,
5856.45,
6062.99,
6276.86,
6498.05,
6726.56,
6963.87,
7209.96,
7464.84,
7727.05,
7999.51,
8282.23,
8573.73,
8876.95,
9188.96,
9514.16,
9849.61,
10196.8,
10555.7,
10927.7,
11313,
11712.9,
12126,
12553.7,
12996.1,
13454.6,
13929.2,
14419.9,
14928.2,
15455.6,
16000.5,
16564.5,
17148.9,
17752.4,
18379.4,
19026.9,
19697.8,
19999.5
],
"On Axis": [
-31.976,
-29.374,
-27.393,
-25.196,
-23.572,
-22.118,
-20.916,
-19.378,
-18.335,
-16.968,
-15.729,
-14.734,
-13.794,
-12.603,
-11.654,
-10.633,
-9.804,
-8.978,
-8.223,
-7.574,
-6.073,
-5.44,
-4.807,
-4.211,
-3.142,
-2.675,
-1.864,
-1.476,
-0.928,
-0.716,
-0.287,
0.136,
0.366,
0.442,
0.655,
0.805,
0.791,
0.516,
1.204,
0.88,
0.864,
0.783,
0.92,
1.121,
1.142,
1.494,
1.383,
1.177,
1.14,
0.627,
0.572,
0.586,
0.831,
0.878,
0.637,
0.166,
-0.305,
-0.209,
0.253,
0.525,
0.297,
0.33,
0.221,
0.11,
0.393,
0.419,
0.372,
0.416,
-0.039,
0.017,
-0.049,
-0.129,
-0.029,
-0.223,
-0.04,
-0.604,
-0.531,
-0.442,
0.045,
-0.536,
-0.935,
-0.369,
-0.653,
-0.282,
-0.013,
-0.755,
-0.162,
-0.073,
-0.018,
0.197,
-0.141,
-0.152,
0.714,
1.07,
2.051,
1.766,
1.735,
1.419,
0.805,
0.57,
0.526,
0.562,
0.226,
0.82,
0.498,
1.022,
0.821,
0.595,
0.556,
1.56,
1.56,
0.983,
1.157,
1.453,
0.58,
0.418,
0.397,
0.447,
0.289,
0.286,
0.899,
0.229,
0.521,
0.893,
1.02,
0.028,
-0.05,
0.796,
1.279,
0.39,
0.498,
1.873,
1.653,
0.717,
0.943,
1.171,
0.82,
0.993,
0.782,
1.046,
0.554,
0.248,
-0.197,
-0.912,
-1.021,
-0.303,
-0.164,
0.516,
0.789,
1.822,
3.067,
3.735,
3.136,
2.304,
1.341,
0.671,
1.324,
1.621,
1.136,
0.967,
1.123,
0.888,
0.268,
0.34,
-0.306,
-0.51,
-0.336,
-0.264,
-0.363,
-0.081,
0.043,
0.198,
0.404,
0.865,
1.423,
2.095,
2.314,
1.996,
2.046,
2.627,
2.994,
2.941,
2.769,
2.664,
2.661,
2.514,
2.04,
1.98,
2.271,
2.47,
2.021,
1.146,
0.707,
0.262
],
"Listening Window": [
-32.524,
-29.828,
-27.782,
-25.518,
-23.856,
-22.369,
-21.139,
-19.569,
-18.502,
-17.112,
-15.856,
-14.847,
-13.894,
-12.701,
-11.733,
-10.709,
-9.872,
-9.04,
-8.28,
-7.613,
-6.102,
-5.464,
-4.825,
-4.224,
-3.148,
-2.678,
-1.86,
-1.467,
-0.914,
-0.7,
-0.266,
0.159,
0.392,
0.468,
0.682,
0.835,
0.825,
0.56,
1.224,
0.914,
0.894,
0.815,
0.946,
1.143,
1.16,
1.502,
1.397,
1.184,
1.154,
0.653,
0.587,
0.586,
0.817,
0.865,
0.632,
0.16,
-0.332,
-0.273,
0.184,
0.452,
0.21,
0.24,
0.131,
0.002,
0.268,
0.31,
0.255,
0.313,
-0.147,
-0.093,
-0.193,
-0.288,
-0.115,
-0.358,
-0.16,
-0.735,
-0.705,
-0.613,
-0.072,
-0.67,
-1.131,
-0.557,
-0.819,
-0.496,
-0.225,
-0.94,
-0.412,
-0.316,
-0.356,
-0.109,
-0.486,
-0.575,
0.245,
0.724,
1.77,
1.549,
1.462,
1.216,
0.588,
0.292,
0.169,
0.169,
-0.12,
0.376,
0.131,
0.646,
0.385,
0.161,
0.056,
0.865,
1.072,
0.645,
0.759,
0.992,
0.231,
-0.079,
-0.196,
-0.175,
-0.198,
-0.262,
0.313,
-0.147,
-0.332,
0.175,
0.179,
-0.556,
-0.641,
0.103,
0.458,
-0.368,
-0.366,
0.983,
0.652,
-0.12,
-0.084,
0.1,
-0.002,
0.015,
-0.43,
-0.251,
-0.761,
-0.822,
-1.293,
-1.494,
-1.359,
-0.897,
-0.808,
-0.038,
0.101,
1.065,
1.675,
1.943,
1.329,
0.738,
0.17,
-0.332,
-0.26,
-0.276,
-0.383,
-0.19,
0.033,
-0.096,
-0.492,
-0.419,
-0.906,
-1.113,
-0.933,
-0.625,
-0.416,
-0.359,
-0.519,
-0.332,
-0.155,
0.17,
0.686,
1.103,
1.298,
1.121,
1.065,
1.444,
1.66,
1.535,
1.257,
0.973,
0.825,
0.597,
0.04,
0.074,
0.233,
0.311,
-0.127,
-1.025,
-1.8,
-2.289
],
"Early Reflections": [
-32.726,
-30.557,
-28.554,
-26.45,
-24.746,
-23.151,
-21.746,
-20.117,
-18.907,
-17.47,
-16.17,
-15.106,
-14.093,
-12.952,
-11.88,
-10.877,
-10.028,
-9.172,
-8.392,
-7.626,
-6.105,
-5.455,
-4.797,
-4.179,
-3.091,
-2.617,
-1.781,
-1.368,
-0.801,
-0.586,
-0.137,
0.289,
0.53,
0.603,
0.806,
0.969,
0.985,
0.802,
1.273,
1.057,
1.014,
0.951,
1.043,
1.23,
1.231,
1.509,
1.401,
1.147,
1.162,
0.766,
0.663,
0.579,
0.682,
0.719,
0.559,
0.157,
-0.321,
-0.482,
-0.216,
0.042,
-0.28,
-0.305,
-0.399,
-0.588,
-0.486,
-0.395,
-0.516,
-0.42,
-0.849,
-0.866,
-1.025,
-1.271,
-0.914,
-1.248,
-1.023,
-1.501,
-1.779,
-1.686,
-1.053,
-1.533,
-2.159,
-1.758,
-1.753,
-1.842,
-1.452,
-2.009,
-1.66,
-1.522,
-1.878,
-1.605,
-1.978,
-2.119,
-2.001,
-1.534,
-0.441,
-0.361,
-0.568,
-0.648,
-1.223,
-1.512,
-1.78,
-2.065,
-2.205,
-2.106,
-2.132,
-1.57,
-2.035,
-2.185,
-1.852,
-1.476,
-1.298,
-1.581,
-1.391,
-1.275,
-1.899,
-2.249,
-2.546,
-2.595,
-2.492,
-2.749,
-2.538,
-2.909,
-3.504,
-3.058,
-3.27,
-4.072,
-4.19,
-3.506,
-3.356,
-4.248,
-4.304,
-3.041,
-3.24,
-3.847,
-3.723,
-3.559,
-3.4,
-3.353,
-3.903,
-3.678,
-4.053,
-3.967,
-3.847,
-3.72,
-3.863,
-3.528,
-3.446,
-2.83,
-2.639,
-2.186,
-1.785,
-1.704,
-2.235,
-2.849,
-3.261,
-3.523,
-3.605,
-3.486,
-3.306,
-3.072,
-2.959,
-3.175,
-3.524,
-3.517,
-3.844,
-4.055,
-4.037,
-3.797,
-3.565,
-3.476,
-3.688,
-3.649,
-3.625,
-3.481,
-3.191,
-2.86,
-2.801,
-3.13,
-3.415,
-3.198,
-3.135,
-3.473,
-3.971,
-4.41,
-4.653,
-5.001,
-5.541,
-5.425,
-5.295,
-5.394,
-5.975,
-6.841,
-7.461,
-7.84
],
"Sound Power": [
-28.69,
-27.511,
-26.111,
-24.925,
-23.581,
-22.145,
-20.705,
-19.302,
-18.048,
-16.746,
-15.548,
-14.503,
-13.487,
-12.503,
-11.385,
-10.468,
-9.681,
-8.836,
-8.052,
-7.211,
-5.785,
-5.161,
-4.512,
-3.912,
-2.868,
-2.418,
-1.602,
-1.189,
-0.643,
-0.443,
-0.005,
0.396,
0.62,
0.677,
0.844,
1.008,
1.059,
0.987,
1.125,
1.055,
0.977,
0.94,
0.965,
1.151,
1.154,
1.347,
1.163,
0.835,
0.928,
0.711,
0.613,
0.448,
0.319,
0.269,
0.237,
0.04,
-0.251,
-0.526,
-0.727,
-0.532,
-0.929,
-1.089,
-1.164,
-1.313,
-1.514,
-1.45,
-1.65,
-1.569,
-1.907,
-2.094,
-2.251,
-2.594,
-2.353,
-2.67,
-2.549,
-2.76,
-3.275,
-3.363,
-2.878,
-3.154,
-3.625,
-3.814,
-3.43,
-3.837,
-3.692,
-3.877,
-3.75,
-3.661,
-3.968,
-4.119,
-4.372,
-4.424,
-4.614,
-4.233,
-3.24,
-2.903,
-3.174,
-3.272,
-3.753,
-4.149,
-4.384,
-4.826,
-5.035,
-5.187,
-5.268,
-4.686,
-5.261,
-5.274,
-4.892,
-4.592,
-4.525,
-4.713,
-4.609,
-4.615,
-5.225,
-5.666,
-5.956,
-6.375,
-6.361,
-6.55,
-6.513,
-6.953,
-7.845,
-7.292,
-7.574,
-8.48,
-8.641,
-8.11,
-8.086,
-8.807,
-8.716,
-7.7,
-7.846,
-8.123,
-7.915,
-7.978,
-7.822,
-7.854,
-8.259,
-8.037,
-8.304,
-8.071,
-7.817,
-7.666,
-7.883,
-7.773,
-7.779,
-7.34,
-7.155,
-7.093,
-6.872,
-6.991,
-7.389,
-7.691,
-7.688,
-7.902,
-8.104,
-7.968,
-7.616,
-7.339,
-7.372,
-7.621,
-7.925,
-7.924,
-8.161,
-8.358,
-8.33,
-8.049,
-7.863,
-7.869,
-8.092,
-8.079,
-8.079,
-8.018,
-7.864,
-7.74,
-7.753,
-7.996,
-8.335,
-8.377,
-8.504,
-8.9,
-9.426,
-9.968,
-10.359,
-10.768,
-11.113,
-10.832,
-10.742,
-10.983,
-11.455,
-12.168,
-12.786,
-13.192
],
"Early Reflections DI": [
0.201,
0.729,
0.771,
0.931,
0.889,
0.782,
0.607,
0.548,
0.405,
0.357,
0.315,
0.26,
0.199,
0.251,
0.147,
0.168,
0.156,
0.132,
0.112,
0.013,
0.004,
-0.009,
-0.028,
-0.044,
-0.057,
-0.061,
-0.079,
-0.099,
-0.113,
-0.115,
-0.129,
-0.13,
-0.138,
-0.135,
-0.125,
-0.134,
-0.161,
-0.241,
-0.049,
-0.144,
-0.12,
-0.137,
-0.098,
-0.087,
-0.071,
-0.007,
-0.004,
0.037,
-0.008,
-0.113,
-0.077,
0.006,
0.135,
0.146,
0.073,
0.003,
-0.011,
0.21,
0.401,
0.41,
0.491,
0.545,
0.53,
0.59,
0.754,
0.705,
0.771,
0.733,
0.702,
0.773,
0.832,
0.982,
0.799,
0.89,
0.863,
0.766,
1.074,
1.072,
0.981,
0.863,
1.029,
1.201,
0.935,
1.346,
1.226,
1.07,
1.248,
1.206,
1.521,
1.496,
1.492,
1.544,
2.246,
2.258,
2.21,
1.91,
2.03,
1.864,
1.811,
1.804,
1.949,
2.234,
2.085,
2.483,
2.262,
2.216,
2.42,
2.345,
1.908,
2.341,
2.37,
2.227,
2.15,
2.267,
2.13,
2.17,
2.351,
2.421,
2.294,
2.487,
2.851,
2.762,
3.172,
3.234,
3.45,
3.516,
3.549,
3.61,
3.813,
3.88,
3.938,
4.024,
3.893,
3.727,
3.638,
3.66,
3.398,
3.369,
3.473,
3.427,
3.292,
3.145,
2.554,
2.225,
2.504,
2.631,
2.638,
2.792,
2.74,
3.251,
3.459,
3.647,
3.563,
3.587,
3.431,
3.191,
3.345,
3.21,
2.923,
2.882,
2.992,
3.079,
3.031,
3.098,
2.938,
2.943,
3.104,
3.173,
3.149,
3.117,
3.169,
3.317,
3.471,
3.652,
3.877,
3.963,
4.099,
4.251,
4.48,
4.642,
4.795,
5.008,
5.228,
5.383,
5.479,
5.598,
5.581,
5.499,
5.529,
5.705,
5.848,
5.816,
5.661,
5.55
],
"Sound Power DI": [
-3.835,
-2.317,
-1.671,
-0.593,
-0.276,
-0.224,
-0.434,
-0.266,
-0.454,
-0.367,
-0.308,
-0.344,
-0.407,
-0.197,
-0.348,
-0.242,
-0.191,
-0.204,
-0.228,
-0.402,
-0.316,
-0.303,
-0.313,
-0.312,
-0.279,
-0.26,
-0.258,
-0.278,
-0.271,
-0.257,
-0.261,
-0.238,
-0.228,
-0.208,
-0.163,
-0.174,
-0.234,
-0.427,
0.099,
-0.141,
-0.083,
-0.125,
-0.02,
-0.008,
0.006,
0.155,
0.234,
0.349,
0.227,
-0.058,
-0.027,
0.138,
0.498,
0.596,
0.395,
0.12,
-0.081,
0.253,
0.911,
0.984,
1.14,
1.329,
1.296,
1.315,
1.782,
1.759,
1.905,
1.882,
1.76,
2.002,
2.058,
2.305,
2.238,
2.313,
2.388,
2.025,
2.57,
2.749,
2.806,
2.484,
2.495,
3.257,
2.611,
3.34,
3.466,
2.937,
3.339,
3.345,
3.611,
4.01,
3.886,
3.849,
4.859,
4.957,
5.01,
4.452,
4.637,
4.489,
4.341,
4.441,
4.553,
4.994,
4.915,
5.563,
5.398,
5.332,
5.646,
5.434,
4.948,
5.458,
5.597,
5.358,
5.368,
5.606,
5.456,
5.587,
5.76,
6.201,
6.163,
6.288,
6.826,
6.806,
7.513,
7.468,
7.753,
7.924,
8,
8.214,
8.544,
8.439,
8.35,
8.683,
8.498,
8.003,
7.83,
8.079,
7.82,
7.869,
7.829,
7.786,
7.543,
7.249,
6.525,
6.172,
6.525,
6.877,
6.971,
7.302,
7.256,
8.158,
8.546,
8.934,
8.718,
8.429,
7.858,
7.57,
7.843,
7.692,
7.234,
7.149,
7.404,
7.525,
7.433,
7.504,
7.255,
7.246,
7.397,
7.424,
7.447,
7.511,
7.572,
7.747,
7.924,
8.188,
8.55,
8.842,
9.052,
9.118,
9.4,
9.822,
10.164,
10.435,
10.683,
10.941,
11.185,
11.366,
11.153,
10.906,
10.976,
11.293,
11.328,
11.143,
10.986,
10.902
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment