Skip to content

Releases: swiftviz/Scale

0.8.0

15 Apr 17:02
Compare
Choose a tag to compare

Concurrency Updates!

The API has changed due to adding Sendable conformances, and constraining some types to @MainActor in order to achieve strict concurrency support. I'm still working on adding full snippets support and expanding examples, but wanted to get the concurrency update out there, even without all the docs I'd hoped to have in place by now.

What's Changed

Full Changelog: 0.7.5...0.8.0

Incremental update

28 Sep 00:25
Compare
Choose a tag to compare

What's Changed

The major additions are:

  • color interpolations and new scales to support interpolated colors, including facilities to interpolate within the LCH color space.
  • basic histogram and binning support
  • initial setup for Date oriented scales and relevant date "ticks" and logic for associated 'nice' values.

Full Changelog: 0.7.0...0.7.5

Chromatic Scales

27 Jun 23:40
Compare
Choose a tag to compare
Chromatic Scales Pre-release
Pre-release

What's Changed

  • Two very impactful changes - the first being that a lot of duplicate code (and types!) were collapsed - Linear, Log, Power, and Radial scales are now all a single type: ContinuousScale, with the same functionality as before. With collapsing it, I also removed the AnyContinuousScale type-erased wrapper, as it was no longer needed with the refactored type.
    • cleanup and deduce of code and types by @heckj in #29
  • Color scales are now included - which include mechanisms to interpolate between colors you provide through a perceptually uniform color space (LCH) as well as replicating a number of the continuous color scales from D3-scale-chromatic. The PR also added a new target to the library that contains SwiftUI views specific to visualizing the color scales and ranges, primarily for a visual review and exploration of the content and values through the lens of various color spaces.
  • The "nice" algorithm was fixed up and collapsed as well, resolving an issue where niceValue wasn't correctly returning "lower" nice values by @heckj in #28

Full Changelog: 0.6.0...0.7.0

Continuous, Discrete, and reversible scales

28 May 20:33
Compare
Choose a tag to compare

A significant (and API breaking) update as Scale was more aggressively used supporting a charting DSL library still in development. The continuous scales were both expanding and combined to support Linear, Log, Power, or Radial scales - and can be utilized through a type-erased AnyContinuousScale. Discrete scales that return a band or a point were also created. Tick values were revised, and the API for accessing and using the scales evolved as the use cases for what information was available at different parts of the lifecycle of a declarative syntax came into focus.

The initial scale creation is now set up such that you can create a scale, then define a "domain" upon it, or update that domain. The pieces for computing a scale value require a range to be set, and reversibility of that mapping was enabled as well in any of the APIs that accept range values. The ranges can be defined as a single value (inferring 0 for the other value), two values, or a swift range instance. All modifier methods return a copy of the scale with the relevant values updated so that the scale can be passed along and more easily used in a functional style setting.

While the structure for the continuous scales seems pretty solid at this point, the discrete scales may see quite a bit of alteration down the road. In particular, the idea of returning a Band structure as a result of a scaling operation rather than a singular value can make for awkward usage scenarios, although the structure itself is useful for bar charts. It may be better as something computer after the fact, and keep the scale (or invert) operations more consistent across the scale APIs.

Scaling that maps through the realm of dates or colors - in discrete or continuous forms - is still pending, and I expect the next revision cycle for scale will accommodate those and the implementation and usage of those scales will potentially set up further changes going forward.

My current thinking for a stable API is to get the discrete color and date/time oriented scales created, and use them in implementations to vet them, before reviewing the API as a whole and locking it down a bit more for backwards compatibility. The primary consumer of this API so far is Chart, now functional but still rapidly evolving. Some discussion of how scale is used and what's needed is included within the chart discussions.

Future updates will include at least a beta release before a 1.0.0 release which will mark backwards compatibility as standard with semantic versioning.

What's Changed

  • Add CGFloat output type scale implementations by @heckj in #9
  • Declarative initializer by @heckj in #10
  • Creating band and point scales by @heckj in #11
  • Reset continuous scales to modifier pattern by @heckj in #12
  • Documentation updates by @heckj in #13
  • Add type erased AnyContinuousScale by @heckj in #14
  • Add radial scale with tests by @heckj in #15
  • Extending Scale type to accommodate range by @heckj in #17
  • Add domain modifier with 'nice' by @heckj in #18
  • Add a single domain value by @heckj in #19
  • Simplify Tick considerably after some usage by @heckj in #20
  • Adding Ticks to AnyContinuousScale by @heckj in #21
  • Ticks protocol by @heckj in #22
  • Tick updates by @heckj in #23
  • Fixing doc references as library has evolved by @heckj in #24
  • Reversed mapping by @heckj in #26

New Contributors

  • @heckj made their first contribution in #9

Full Changelog: 0.5.0...0.6.0

Initial Scale release

31 Mar 18:51
Compare
Choose a tag to compare
Initial Scale release Pre-release
Pre-release

The code in this release was previously included in SwiftViz. In order to re-order things so that SwiftViz is the overall collection, it was useful to move this code into it's own a repository and Swift module so that other packages under this organization (Chart) could use it and then later also be collected into the overall setup under SwiftViz.

Related issues have been migrated to this repository and doc links updated.

The release is functional, but the API structure is far from certain, with some additional scales and usage considerations I'd like to include before I get close to calling this a 1.0 release. (See #1, #2, #4, and #5 in particular).

The code within this package includes a Scale concept, implemented with Swift generics - as well as the algorithms for generating "nice" values for more convenient visualization results, and ticks for labeling a visual axis that might be associated with the scale.