Skip to content

Conversation

@blerner
Copy link
Member

@blerner blerner commented Oct 12, 2025

fixes #1829 -- various charts visual changes (and new features)
fixes #1813 -- chart images need pinholes
fixes #1831 -- image-url doesn't work offline because of setAttribute missing

Ben Lerner added 12 commits October 5, 2025 22:18
…` method to bad-chart and multi-bar-chart

The given bandwidth must be in (0, 1], and represents the percentage of available space filled by bars:
- 0% bandwidth would be zero-width bars
- 100% bandwidth would have no padding between bars

The default bandwidth is 80%
…ter plots, and adding non-linear axes

- the padding is handled as best as I can manage, by measuring the images' overhang in pixels outside the edges of the chart,
  then inverting those pixels back into domain units, and extending the axes by those amounts.  this is not quite right,
  since there is additional padding outside the chart area, but it's pretty good.  (this padding is needed because the extreme
  points of a scatter plot are clipped by the chart area, which in turn is needed to ensure composite plots are of reasonable size)
- the non-linear axes are supported by adding a new pair of window methods, `.{x,y}-axis-type(type)`, and a new enum
  - at-linear
  - at-pow(power) ==> quadratic, cubic, square-root, etc
  - at-log(base) ==> logarithmic
  - at-symlog(constant) ==> symmetric-logarithmic
  Vega does not support exponential-mapped axes, which is probably fine...
  Images being non-clipped on non-linear axes is not guaranteed (in fact, since the axes compress the extreme values,
    it's more likely than not!)
The real problem with #1813 was that OverlayImage was using the .pinholeX/Y fields without
first checking for existence, which is what the .getPinholeX/Y() methods are for.  The real
fix is therefore to use those methods everywhere.
- marks *all* axes as explicitly containing zero or not, rather than relying on defaults
- also fixes incorrect margin calculations when images aren't used
- also fixes incorrect clipping region coordinates (reverts experimental change)
- fixes various typos of left/right/top/down/[0]/[1]
@blerner blerner requested a review from jpolitz October 13, 2025 20:33
@jpolitz jpolitz merged commit 4ce8823 into horizon Oct 16, 2025
2 checks passed
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.

image-url does not work in command-line pyret Requested visual changes to charts library Chart images need pinholes

3 participants