packages feed

hvega-0.11.0.1: tests/specs/gallery/bar/logscaled.vl

{
    "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
    "data": {
        "values": [
            {
                "x": 1.0e-2
            },
            {
                "x": 0.1
            },
            {
                "x": 1
            },
            {
                "x": 1
            },
            {
                "x": 1
            },
            {
                "x": 1
            },
            {
                "x": 10
            },
            {
                "x": 10
            },
            {
                "x": 100
            },
            {
                "x": 500
            },
            {
                "x": 800
            }
        ]
    },
    "description": "Log-scaled Histogram (may improve after https://github.com/vega/vega-lite/issues/4792)",
    "encoding": {
        "x": {
            "axis": {
                "tickCount": 5
            },
            "field": "x1",
            "scale": {
                "base": 10,
                "type": "log"
            },
            "type": "quantitative"
        },
        "x2": {
            "field": "x2"
        },
        "y": {
            "aggregate": "count",
            "type": "quantitative"
        }
    },
    "mark": "bar",
    "transform": [
        {
            "as": "logX",
            "calculate": "log(datum.x)/log(10)"
        },
        {
            "as": "binLogX",
            "bin": true,
            "field": "logX"
        },
        {
            "as": "x1",
            "calculate": "pow(10,datum.binLogX)"
        },
        {
            "as": "x2",
            "calculate": "pow(10,datum.binLogX_end)"
        }
    ]
}