Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing mark properties #153

Open
espears4sq opened this issue Sep 6, 2018 · 1 comment
Open

Missing mark properties #153

espears4sq opened this issue Sep 6, 2018 · 1 comment

Comments

@espears4sq
Copy link

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
Copy link
Collaborator

oshikiri commented Sep 8, 2018

There are available mark configs.

def configMark(filled: OptArg[Boolean] = NoArg, color: OptArg[String] = NoArg, fill: OptArg[String] = NoArg,
stroke: OptArg[String] = NoArg, opacity: OptArg[Double] = NoArg, fillOpacity: OptArg[Double] = NoArg,
strokeOpacity: OptArg[Double] = NoArg, strokeWidth: OptArg[Double] = NoArg, strokeDash: OptArg[List[Double]] = NoArg,
strokeDashOffset: OptArg[Double] = NoArg, stacked: OptArg[StackOffset] = NoArg, orient: OptArg[Orient] = NoArg,
interpolate: OptArg[Interpolate] = NoArg, tension: OptArg[Double] = NoArg, lineSize: OptArg[Double] = NoArg,
ruleSize: OptArg[Double] = NoArg, barSize: OptArg[Double] = NoArg, barThinSize: OptArg[Double] = NoArg,
shape: OptArg[Shape] = NoArg, customShape: OptArg[String] = NoArg, size: OptArg[Double] = NoArg, tickSize: OptArg[Double] = NoArg,
tickThickness: OptArg[Double] = NoArg, align: OptArg[HorizontalAlign] = NoArg, angle: OptArg[Double] = NoArg,
baseline: OptArg[VerticalAlign] = NoArg, dx: OptArg[Double] = NoArg, dy: OptArg[Double] = NoArg,
radius: OptArg[Double] = NoArg, theta: OptArg[Double] = NoArg, font: OptArg[String] = NoArg,
fontSize: OptArg[Double] = NoArg, fontStyle: OptArg[FontStyle] = NoArg, fontWeight: OptArg[FontWeight] = NoArg,
format: OptArg[String] = NoArg, shortTimeLabels: OptArg[Boolean] = NoArg, text: OptArg[String] = NoArg,
applyColorToBackground: OptArg[Boolean] = NoArg) = {

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants