Skip to content

2.2.0

Compare
Choose a tag to compare
@gampleman gampleman released this 26 Apr 11:32
· 33 commits to master since this release

For some time we have been adding major features to elm-visualization. However, often these features were in an MVP form and the time has come to flesh these out and provide more options to our modules. This release has been more than a year in the making and ships a huge number of improvements.

Force

The force module adds several new forces that you can use to adjust force based layouts:

  • Force.collision and Force.customCollision provide a 2D collision detection system. This can be useful for avoiding overlap if you have larger nodes or making beeswarm plots.
  • Force.towardsX and Force.towardsY allow you to attract nodes to a specific X or Y position.
  • Force.customRadial is similar, but positions nodes to the nearest point on a specified circle.

Interpolation

Screenshot 2021-04-26 at 13 21 11

Interpolation .hcl, Interpolation.hclLong and Interpolation.lab join the existing Interpolation.rgb, Interpolation.rgbWithGamma and Interpolation.hsl as ways to interpolate between colours. These new interpolators are better in being more perceptually uniform and can be more suitable for use in Scales (or even for animations by skipping some ugly washed out colours).

Many thanks to @deciob for adding these.

Scale

This release adds 13 new scales:

  • Scale.radial is a new type of continuous scale that is suitable for when a marks circular area is proportional to the value represented.

  • Scale.diverging is like Scale.sequential, but includes a middle neutral point. Can be used for things where there is a natural zero and things above or below, like temperature in degrees or political leaning.

  • Scale.quantile maps a sampled input domain to a discrete range. The number of values in the output range determines the number of quantiles that will be computed from the domain.

  • Scale.threshold allows you to chunk your continuous data into arbitrary segments:

    temperatureScale = threshold ( blue, [ ( 0, yellow ), ( 200, red )])

    would be blue under 0, yellow between 0 and 200, and red otherwise.

  • Scale.point scales are a variant of band scales with the bandwidth fixed to zero. Point scales are typically used for scatterplots with an ordinal or categorical dimension.

  • Scale.symlog is a continuous scale which is similar to a log scale, but is suitable to be used with datasets that pass zero.

Finally, we implement transformed versions for sequential and diverging scales: sequentialLog, sequentialPower, sequentialSymlog, divergingLog, divergingPower, divergingSymlog. These are just like the continuous versions, but use an interpolator instead of a ( Float, Float ) range.

Scale.nice for continuous scales now runs to a fix point, so applying it more than once will now make no difference. This should also make nice slightly... well... nicer.

Scale.Color

Scale.Color adds a dizzying 52 new built-in color schemes:

elm-visualization netlify app_colormaps_iframe html (3)

Many thanks to @deciob for adding these.

Statistics

Adds a peaks function for automatically detecting peaks in time series:

Screenshot 2021-04-26 at 14 13 46

Transition

The transition module adds 21 new easing functions to customise how animations progress: easeBack, easeBackIn, easeBackOut, easeBounce, easeBounceIn, easeBounceOut, easeCircle, easeCircleIn, easeCircleOut, easeElastic, easeElasticIn, easeElasticOut, easeExponential, easeExponentialIn, easeExponentialOut, easePolynomial, easePolynomialIn, easePolynomialOut, easeSinusoidal, easeSinusoidalIn, and easeSinusoidalOut.

Zoom

A small bug with detecting mouse position in some SVG context has been fixed.

Many thanks to @woylie for contributing this.

Examples

Our examples website has been streamlined with a slight redesign. The examples are now divided into categories to make everything a bit easier to navigate. Examples now include the data they need to run (thanks @Anton-4), show a link to an editable Ellie and have been refactored slightly to make them easier to follow (thanks again @Anton-4) and some smaller issues have been fixed (thanks @megapctr).

Furthermore a number of new examples have been added (thanks to @woylie, @Anton-4, and @deciob for contributing many of these).