Vega-lite: Difference between revisions

From Bitpost wiki
(Created page with "=== Shapes and Colors === To use shapes and colors for data series, ensure that the data source is a STRING not NUMBER, then: "mark": "point", // when using sha...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=== Basics ===
Add this to your css to get rid of the links back to Vega:
.vega-actions {
  display:none;
}
=== Shapes and Colors ===
=== Shapes and Colors ===


Line 12: Line 20:
You can use a hardcoded size for shapes and cirles:
You can use a hardcoded size for shapes and cirles:


             "size": {"field": "Cylinders", "type": "quantitative"}
             "size": {"value": 200}


Or you can use a NUMBER as a quantitative type:
Or you can use a NUMBER as a quantitative type:


             "size": {"value": 200}
             "size": {"field": "Cylinders", "type": "quantitative"}

Latest revision as of 15:05, 3 March 2018

Basics

Add this to your css to get rid of the links back to Vega:

.vega-actions {
  display:none;
}

Shapes and Colors

To use shapes and colors for data series, ensure that the data source is a STRING not NUMBER, then:

         "mark": "point",    // when using shape field in encoding
         "encoding": {
           "shape": {"field": "Name", "type": "nominal"},
           "color": {"field": "Name", "type": "nominal"},

Size

You can use a hardcoded size for shapes and cirles:

           "size": {"value": 200}

Or you can use a NUMBER as a quantitative type:

           "size": {"field": "Cylinders", "type": "quantitative"}