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

Repeat #1262

Merged
merged 24 commits into from
Mar 25, 2016
Merged

Repeat #1262

merged 24 commits into from
Mar 25, 2016

Conversation

domoritz
Copy link
Member

todo: clean up a bit and merge layouts if conventient. Maybe think about how to order transforms.

SPLOM

{
  "repeat": {
    "row": ["Horsepower","Miles_per_Gallon","Displacement"],
    "column": ["Displacement","Miles_per_Gallon","Horsepower"]
  },
  "spec": {
    "data": {"url": "data/cars.json"},
    "mark": "point",
    "encoding": {
      "x": {
        "field": {"repeat": "column"},
        "type": "Q",
        "scale": {"zero": false}
      },
      "y": {
        "field": {"repeat": "row"},
        "type": "Q",
        "scale": {"zero": false}
      },
      "color": {"field": "Origin","type": "N"}
    }
  }
}

vega

Crossfilter

{
  "repeat": {"column": ["hour", "delay", "distance"]},
  "spec": {
    "layers": [
      {
        "data": {"url": "data/flights-2k.json"},
        "transform": {"calculate": [{"field": "hour", "expr": "hours(datum.date)"}]},
        "mark": "bar",
        "encoding": {
          "x": {"field": {"repeat": "column"}, "type": "Q", "bin": true},
          "y": {"aggregate": "count", "field": "*", "type": "quantitative"},
          "color": {"value": "steelblue"}
        }
      },{
        "data": {"url": "data/flights-2k.json"},
        "transform": {
          "calculate": [{"field": "hour", "expr": "hours(datum.date)"}],
          "filter": "datum.delay < 5"
        },
        "mark": "bar",
        "encoding": {
          "x": {"field": {"repeat": "column"}, "type": "Q", "bin": true},
          "y": {"aggregate": "count", "field": "*", "type": "quantitative"},
          "color": {"value": "goldenrod"}
        }
      }
    ]
  }
}

vega 1

burtin (had to hack the layout a bit)

{
  "repeat": {
    "column": ["Penicilin", "Streptomycin", "Neomycin"]
  },
  "spec": {
    "data": {"url": "data/burtin.json"},
    "mark": "point",
    "encoding": {
      "x": {"field": {"repeat": "column"}, "type": "Q", "scale": {"type": "log"}},
      "y": {"field": "Bacteria", "type": "N", "axis": {"labelMaxLength": 20}},
      "color": {"field": "Gram_Staining", "type": "N"}
    }
  }
}

vega

"showOutput": "silent",
"tasks": [
{
// "npm run build"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. JSON shouldn't have JS comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix in on master


if (fieldDef.bin) { // bin has default suffix that depends on scaleType
opt = extend({
opt = extend({}, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to add this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't

@domoritz domoritz changed the title [WIP] Repeat Repeat Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants