glimpseio / glacier

https://glimpseio.github.io/glacier/
MIT License
0 stars 1 forks source link

Refactor to support multiple-layer visualizations #102

Open weswigham opened 7 years ago

weswigham commented 7 years ago

For example, to support a line chart which also has error bars and point marks.

We missed this, since the vega-lite documentation doesn't mention it (and zero examples make use of it), but it does support specifications like so (you can drop it into the live demo on the vega-lite webpage and watch it work):

{
  "description": "Google's stock price over time.",
  "data": {"url": "data/stocks.csv","format": {"type": "csv"}},
  "transform": {"filter": "datum.symbol==='GOOG'"},
  "layers": [
    {
      "mark": "line",
      "encoding": {
        "x": {"field": "date","type": "temporal"},
        "y": {"field": "price","type": "quantitative"}
      }
    },
    {
      "mark": "circle",
      "encoding": {
        "x": {"field": "date","type": "temporal"},
        "y": {"field": "price","type": "quantitative"}
      }
    }
  ]
}

I think it's just mark and encoding which can be layered. The lack of documentation makes this unclear.

For us, generally speaking, this means introducing a concept of a layer id/reference, then requiring that it be passed around with any call modifying a mark, encoding, or anything else layer-specific.

marcprux commented 7 years ago

Layers were tacked on late in the vega-lite 1.x release, and I believe the feature remained undocumented due to there being a number if issues with them. Furthermore, I think they are being refactored 2.0. So I wouldn't spend any time on them at this point, but it'd definitely be nice to have someday.

weswigham commented 7 years ago

Vega-lite 2.0 is in prerelease, and seems to be mostly spec-compatible. Upgrading would mostly be upgrading the types we have for Vega.

On Thu, Apr 6, 2017, 1:08 PM mprudhom notifications@github.com wrote:

Layers were tacked on late in the vega-lite 1.x release, and I believe the feature remained undocumented due to there being a number if issues with them. Furthermore, I think they are being refactored 2.0. So I wouldn't spend any time on them at this point, but it'd definitely be nice to have someday.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/glimpseio/glacier/issues/102#issuecomment-292240909, or mute the thread https://github.com/notifications/unsubscribe-auth/ACzAMgsOcbTxN-sCdDIvdba6CYRRCN0-ks5rtRwFgaJpZM4MyKR9 .