vegas-viz / Vegas

The missing MatPlotLib for Scala + Spark
MIT License
730 stars 98 forks source link

Missing mark properties #153

Open espears4sq opened 6 years ago

espears4sq commented 6 years ago

In vega, mark types have properties, such as binSpacing which is a property of the Bar mark type. For example, it's very standard when plotting a histogram to have binSpacing set to 0, like this:

{
  "data": {"url": "data/movies.json"},
  "mark": {"type": "bar", "binSpacing": 0},
  "encoding": {
    "x": {
      "bin": {"maxbins": 10},
      "field": "IMDB_Rating",
      "type": "quantitative"
    },
    "y": {
      "aggregate": "count",
      "type": "quantitative"
    }
  }
}

But currently it does not seem possibly in vegas to supply any mark properties, or else this is undocumented.

oshikiri commented 6 years ago

There are available mark configs. https://github.com/vegas-viz/Vegas/blob/d1941b6680f660e45fa95b94551b93e01ecf5d32/core/src/main/scala/vegas/DSL/ConfigDSL.scala#L51-L63

Unfortunately, some of these configs are renamed.

config.mark.barBinSpacing/barThinSize/barSize => config.bar.binSpacing/continuousBandSize/discreteBandSize

And, barBinSpacing does not seem to be available in vega-lite v1.2.0 which Vegas currently depends on. See https://github.com/vega/vega-lite/blob/v1.2.0/site/docs/config.md#bar-config