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

[Feature Anywhere] Dynamically update vega spec to show VisLayers #3130

Closed
ohltyler opened this issue Dec 23, 2022 · 2 comments
Closed

[Feature Anywhere] Dynamically update vega spec to show VisLayers #3130

ohltyler opened this issue Dec 23, 2022 · 2 comments

Comments

@ohltyler
Copy link
Member

As a follow-up to #3122 , after VisLayers are collected, we will want to pass them into the relevant render function to be processed. This will primarily involve making changes to the vega spec, such that a VisLayer will require adding a new layer that will be visible on the chart (see mockups in #2088 as an example).

@ohltyler
Copy link
Member Author

There are a few options to add events / VisLayers on the chart:

  1. adding a layer to the existing view and placing at the bottom of the chart. X-axis can be offset to provide more room for the event marks
  2. adding an entirely new view and connecting both via vconcat

Pros/cons of each:
Option 1 - pros:

  • less code changes and fundamental changes to the existing spec
  • can utilize the existing autosize field to dynamically fit the vis embeddable container
  • no need to maintain multiple x-axes configurations & ensuring they line up correctly

Option 1 - cons:

  • inconsistent with existing experience (TSVB)
  • potential obstruction if the lines come close to the x-axis

Option 2 - pros:

  • dedicated space (including empty state) for events
  • guaranteed that there will be no obstruction between values & event markers

Option 2 - cons:

  • unable to use autosize field due to limitations (note this is what is currently used in the VegaParser)
  • difficulty / potential edge cases in maintaining x-axis consistency across charts
  • complex logic for trying to generate the size on-the-fly based on the number of views in vconcat/hconcat

@joshuarrrr joshuarrrr added v2.8.0 and removed v2.7.0 labels Mar 23, 2023
@ohltyler
Copy link
Member Author

Resolved via #3145

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