question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Band support for the time-based scale

See original GitHub issue

A very common graph is a bar chart with the temporal X axis. Yet, Vega has relatively little support for that usecase. Graph designers must hardcode the bar width, like the wheat & wages example, and know ahead of time the “bar unit” of dates, e.g. monthly vs daily. This goes against the whole idea of the data driver graphs.

Goals

  • time scale should calculate the smallest gap size between time elements, and use it as the band width.
  • there should be a way to restrict that size with min/max as percentages of the width
  • time scale should work similar to the band scale: width: {scale: 'xscale', band: 1} (consistent, simpler for novice users)
  • the band size should account for any padding/rounding that time scale adds
  • it should be possible for the user to add in-between bar padding, same as in band scale

Note that there was a similar request in 2013, but there was no example for it, so there might be a workaround.

CC: @domoritz @dnmiller @gerwitz @mkscrg

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:13
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
kanitwcommented, Aug 17, 2019

@josesaranda Im not sure what you mean “the approach interaction occurs”.

In any case, one can make timeUnit “band” on a continuous scale by calculating two new fields, one for the start of the time unit and another for the end of time unit. Then we can draw rect from start to the end like this.

This is also the approach that we take in Vega-Lite 4.0.

image
2reactions
nyurikcommented, Jun 5, 2018

@kanitw your example highlights the issue I was talking about – you have to “know” your data range when designing the graph – by specifying yearmonth. You cannot design a truly data-driven graph, where the data decides the time units - months or minutes, and the graph can change on the fly depending on the data given.

The bands here are not discrete, but are also continuous. Bars do not have to align - in fact bars could appear at any place anywhere on the scale. It is imputing that makes them descrete. Using minimum gap as the bar width will make both the continuous and “pre-descretized” (data generated on the server as buckets) data work the same way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using automatic time-based scaling - AWS OpsWorks
Time-based scaling lets you control how many instances a layer should have online at certain times of day or days of the week...
Read more >
Reducing project infrastructure costs by time based scaling for ...
Reducing infrastructure costs is quite simple: just make sure your application environments are not running, when you don't need them.
Read more >
Kubernetes Autoscaling: 3 Methods and How to Make Them ...
Pod-based scaling—supported by the Horizontal Pod Autoscaler (HPA) and the newer Vertical Pod ... You cannot scale up a size 0 node group...
Read more >
Scaling based on schedules - Compute Engine - Google Cloud
If you run your workload on a managed instance group (MIG), ... Cron is a time-based job scheduler originally used in Unix-like computer...
Read more >
Time Based Scaling for Kubernetes Deployments - Medium
Each CronJob is passed the Kubectl patch command for their respective service's HPA to only patch the minimum replica count. Scale-Up Job:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found