clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

main
diagramzip / examples / diagrams / discretizing-scale.vlite
discretizing-scale.vlite 2.7K
1{2 "$schema": "https://vega.github.io/schema/vega-lite/v4.json",3 "description": "Horizontally concatenated charts that show different types of discretizing scales.",4 "data": {5 "values": [6 {"a": "A", "b": 28},7 {"a": "B", "b": 55},8 {"a": "C", "b": 43},9 {"a": "D", "b": 91},10 {"a": "E", "b": 81},11 {"a": "F", "b": 53},12 {"a": "G", "b": 19},13 {"a": "H", "b": 87},14 {"a": "I", "b": 52}15 ]16 },17 "hconcat": [18 {19 "mark": "circle",20 "encoding": {21 "y": {22 "field": "b",23 "type": "nominal",24 "sort": null,25 "axis": {26 "ticks": false,27 "domain": false,28 "title": null29 }30 },31 "size": {32 "field": "b",33 "type": "quantitative",34 "scale": {35 "type": "quantize"36 }37 },38 "color": {39 "field": "b",40 "type": "quantitative",41 "scale": {42 "type": "quantize",43 "zero": true44 },45 "legend": {46 "title": "Quantize"47 }48 }49 }50 },51 {52 "mark": "circle",53 "encoding": {54 "y": {55 "field": "b",56 "type": "nominal",57 "sort": null,58 "axis": {59 "ticks": false,60 "domain": false,61 "title": null62 }63 },64 "size": {65 "field": "b",66 "type": "quantitative",67 "scale": {68 "type": "quantile",69 "range": [80, 160, 240, 320, 400]70 }71 },72 "color": {73 "field": "b",74 "type": "quantitative",75 "scale": {76 "type": "quantile",77 "scheme": "magma"78 },79 "legend": {80 "format": "d",81 "title": "Quantile"82 }83 }84 }85 },86 {87 "mark": "circle",88 "encoding": {89 "y": {90 "field": "b",91 "type": "nominal",92 "sort": null,93 "axis": {94 "ticks": false,95 "domain": false,96 "title": null97 }98 },99 "size": {100 "field": "b",101 "type": "quantitative",102 "scale": {103 "type": "threshold",104 "domain": [30, 70],105 "range": [80, 200, 320]106 }107 },108 "color": {109 "field": "b",110 "type": "quantitative",111 "scale": {112 "type": "threshold",113 "domain": [30, 70],114 "scheme": "viridis"115 },116 "legend": {117 "title": "Threshold"118 }119 }120 }121 }122 ],123 "resolve": {124 "scale": {125 "color": "independent",126 "size": "independent"127 }128 }129}