Skip to content

vega-lite could be a promising direction for this page #13

Open
@jhnwllr

Description

@jhnwllr

vega-lite
https://vega.github.io/vega-lite/

I made this graph directly using a csv provided by the analytics output:
occ_kingdom_basisOfRecord.csv

https://blockbuilder.org/jhnwllr/c9461b61f2dcd938d38909bab91c5344

All that was necessary was this json specification file.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "description": "A simple bar chart with embedded data.",
  "width": 400,
  "height":300,
  "data": {"url":"https://gist.githubusercontent.com/jhnwllr/f9eee906345f1cb53b8931347d57fa22/raw/2198298239da88b8db40aa98cc0a7ce47613f4d6/occ_kingdom_basisOfRecord.csv"},
"format": {"type": "csv"},  
"mark": "bar",
  "encoding": {
    "x": {"field": "snapshot", "type": "ordinal"},
    "y": {"field": "occurrenceCount", "type": "quantitative"},
    "tooltip": {"field": "basisOfRecord", "type": "nominal"},
    "color": {
      "field": "basisOfRecord",
      "type": "nominal",
      "scale": {
        "domain": 
       ["PRESERVED_SPECIMEN", 
       "UNKNOWN", 
       "FOSSIL_SPECIMEN",
       "LIVING_SPECIMEN",
       "HUMAN_OBSERVATION",
       "OBSERVATION",
       "LITERATURE",
       "MACHINE_OBSERVATION",
       "MATERIAL_SAMPLE"],
       "range": ["#c00000", "#ff4f00", "#fcff00", "#0c8900", "#0085ff","#aab8ab","#5da9b7"]
      },
       "order": {"aggregate": "sum", "field": "occurrenceCount", "type": "quantitative"}
 }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions