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.

Allow config to set default scale.zero per marktype

See original GitHub issue

scale.zero is true as default for x and y channels if the quantitative field is not binned and no custom domain is provided; false otherwise. (https://vega.github.io/vega-lite/docs/scale.html ) Though, for some range-based-marktype (e.g., point, box plot). zero: true might not be useful default; if the data are mostly distributed 10M~11M and if the scale includes zero, the point marks for those data will look like just a single dot.

Even the example scatter plot in VL editor uses zero: false. If we delete it, it looks like this: image

Suggestion Assuming that many VL users may be already used to the current default, I would like to suggest adding config.scale.zero to change the default instead of changing system default.

{
  "config": { "scale": {"zero": "always" } } 
}

-> Keep the system defulat: scale.zero is true as default for x and y channels if the quantitative field is not binned and no custom domain is provided; false otherwise.

{
  "config": { "scale": {"zero": "range-mark-only" } } 
}

-> scale.zero is true as default for y(/x) channel if the quantitative field is not binned and no custom domain is provided and it is vertical (/horizontal) bar and area; false otherwise.

CC; @kanitw

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kanitwcommented, Aug 11, 2022

Some more thoughts:

  • Btw, I think “range mark” is a bit vague – I don’t think we have use the key word anywhere else.

  • Suppose we add dynamic default in the future with some syntax like {threshold: 0.25} (it might not be this syntax, but we need to make our syntax future proof).

  • Thinking more, we could also just add zero: boolean; to config.scale but make it not applicable to non-range bar/area

    • Basically config.scale.zero will be applicable for point/line, etc., but not for non-range bar/area chart.
    • For ranged bar (e.g., gantt chart and ranged area, we also don’t need to include zero), so config.scale.zero should also be applicable to them.
1reaction
kanitwcommented, Aug 9, 2022

FWIW, https://github.com/vega/vega/issues/1471 is related to this. (Adding dynamic zero with threshold is probably gonna be a better default than always off.)

In terms of sequencing, I think add this config in Vega-Lite first would be easier (since it’s simpler).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring scale bounds - Knative
You can configure upper and lower bounds to control autoscaling behavior. ... key: initial-scale in combination with allow-zero-initial-scale; Per-revision ...
Read more >
altair.Scale — Altair 4.2.0 documentation
Default value: derived from the scale config 's clamp ( true by default). ... Sets the maximum value in the scale domain, overriding...
Read more >
Top-Level Chart Configuration — Altair 4.1.0 documentation
The Chart.configure_header() method allows configuration of facet headers, including the font, color, size, and position of the title and labels.
Read more >
Cisco Catalyst 9800 Series Wireless Controller Software ...
To enable AVC based policies, and configure the following: Choose either Match Any or Match All. Choose the required Mark Type. If you...
Read more >
Step 3: Configure advanced settings (optional)
Now that you have specified the scaling strategy to use for each resource type, you can choose to customize any of the default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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