Skip to content

Latest commit

 

History

History
515 lines (299 loc) · 23.6 KB

CHANGELOG.md

File metadata and controls

515 lines (299 loc) · 23.6 KB

Changelog

8.1.4

2024-05-06

Rebuilt the lockfile because of this issue with GitHub CI. Bumping to a new version just so everyone has the same lockfile.

8.1.3

2024-05-06

Make compatible with Svelte 5. Note: This does not update the API to use runes, eliminate the use of stores or get rid of reactive statements. Thanks to @rgieseke for the help on this!

8.1.2

2024-04-24

Excludes flatData from the debug printout if it's null.

8.1.1

2024-03-12

Following up on 8.0.3, adds flatData to the debug printout.

8.1.0

2024-03-11

This adds xDomainSort, yDomainSort, zDomainSort and rDomainSort props that will kick in when the scale is ordinal. By default, unique value calculations return a sorted list. You can now use these props to set that to false and return the uniques in the order they appeared in the data.

Also updates the API to calcUniques helper function to also accept field-specific sort instructions.

8.0.3

2024-03-07

Also print the data object when debug is set.

8.0.2

2023-10-14

Corrects the change in 8.0.0 for sorting a domain by adding a comparator function to better sort strings and dates. Also fixes an oversight where domains that were dates would not be calculated uniquely. Also some security upgrades. Closes #151

Note: Due to a publishing error, there is no 8.0.1

8.0.0

2023-09-19

When calculating uniques for an ordinal scale's domain, sort the list. This will help in case your input data changes order, in which case your colors may be off (if using that dimension for a color scale). This is technically a breaking change although it may not actually affect any live charts.

7.6.1

2023-07-19

Fixes JSDoc types to allow for null values in the xDomain, yDomain etc. props. Thanks @rgieseke!

7.6.0

2023-06-27

Upgrade to Svelte 4.0. Set version 3 and 4 as a peer dep.

7.5.0

2023-06-25

Add accessibility props to layout components.

7.4.0

2023-04-15

Expose context values as slot props. Make the defaults for yReverse reactive post-load.

7.3.5

2023-04-04

Dependabot fix

7.3.4

2023-03-17

Bring back the "main": "./dist/index.js", field in package.json for legacy build systems.

7.3.3

2023-03-17

Align values better in print debug output.

7.3.2

2023-03-17

Cut down on dependencies by using d3-color for contrast detection

7.3.1

2023-03-16

Adds the debug-mode prop. Note: 7.3.0 was skipped because of an npm error.

7.2.3

2023-03-16

Correct the types on the xDomain, rDomain, zDomain, rDomain props to reflect that the values can be null to inherit the calculated min or max. Updates svelte-package and package.json to use exports field. Adds Typescript 5 as a peerDep.

7.2.2

2022-12-26

Add the d3-shape and d3-array as dependencies to handle new helper functions. Note: 7.2.1 was skipped because of an npm error.

7.2.0

2022-12-23

This release adds new functions: bin, stack, groupLonger and takeEvery. It also adds a new second argument to flatten.

7.1.0

2022-10-03

Allow for all nNice props to take a number instead of just a boolean.

7.0.0

2022-07-10

This release has a few new features that should make for nicer default charts when working with ordinal scales. Many thanks to @techniq for kicking things off with this. Here are the highlights:

  1. When setting a scaleBand or scalePoint scale, the yRange is no longer reversed by default PR #85.
  2. If the scale already has a custom interpolator function, don't set the range. This helps when using scaleSequential and scaleDiverging for a color scale. Interpolators are kind of like ranges but set with a different method. Before, any custom interpolator you set when passing in the scale would get overridden when the range was set automatically PR #89.
  3. If setting a scaleOrdinal, scaleBand or scalePoint, the calculated extents will be a series of unique values instead of [min, max] PR #90.
  4. A new function called calcUniques which has the same API as calcExtents but calculates unique values instead of mins and maxes.

This is technically a breaking change because the behavior is different but the only real change you would see would be the order of an ordinal y scale will be unreversed – which may be more correct than what it was previously.

6.1.2

2022-07-10

Makes a more helpful error message when the data passed into calcExtents isn't an array.

6.1.1

2022-06-24

Fixes some typos in documentation

6.1.0

2022-02-22

This adds an innerElement prop you can bind to on the <Svg> component that lets you bind to the <g> element. Mostly this release improves reactivity by setting initial values for store values and changing the syntax from using .set to using assignments, which apparently helps Svelte understand the topology. This should lead to fewer re-renders. It also will only warn about negative dimensions on the parent container once DOM elements are mounted. So you won't get a warning because the code was executed before the DOM was able to measure it. This release improves layout components by using new style directives.

6.0.1

2022-01-19

Fill in a misssing documentation line for the padding prop.

6.0.0

2022-01-16

Layer Cake is now built with SvelteKit and the website is included in this repo instead of the layercake.graphics repo. This is a new major version since that seemed like a clean way to separate out any problems that might arise from the SvelteKit build process but there shouldn't actually be any breaking changes. One new feature is you'll now get TypeScript type hints when using the library (powered by JSDoc comments). Many thanks to everyone who helped](#58) sort out best practices for that. There are a lot of commits in this release so instead of including them all here, here's the diff between this release and 5.0.3: https://github.com/mhkeller/layercake/compare/v5.0.3...v6.0.0

5.0.3

2021-12-14

Fix an extra argument that was causing the aspectRatio context val to be NaN. PR #55 from @techniq to add "svelte": "src/index.js" to package.json, fixes #54.

5.0.2

2021-12-08

PR from @benmccann to add type: "module" in package.json to modernize and rename master branch to main.

5.0.1

2021-11-24

A minor internal change where calcExtents is only called when there are active keys. This change preempts an error where a zGet function was optionally called in the Map component. Because zGet existed in the component, the library was running this bit of code. The calcExtents resulted in an error because the data was a geojson object, not an array. Adding this check will allow components that don't necessarily use getters to include references to those functions so they are more reusable.

5.0.0

2021-06-20

Breaking change: The API to calcExtents now takes an object instead of an array of objects. See this issue for more info. Many thanks to @jtrim-ons for taking the initiative on this!

This shouldn't change much since this is mostly an internal function. If you've used the example components for the Small Multiples or Timeplot graphics, take a look here on how to update those components to conform with the new API.

The old API took an array of objects for the fields variable like this:

[
  {
  { field: 'x', accessor: d.myX },
  { field: 'y', accessor: d.myY },
  { field: 'z', accessor: d.myZ },
  { field: 'r', accessor: d.myR }
]

Now it takes an object like this:

{
  x: d.myX,
  y: d.myY,
  z: d.myZ,
  r: d.myR
}

The function returns the same object as before.

4.1.1

2020-06-29

Thanks to @jtrim-ons for this PR, the uniques calculation now uses a Set to test for uniqueness, which is much faster. Issue #46.

4.1.0

2021-03-17

Export the layout component elements and any canvas contexts as bindable variables and also as slot props. It also updates the scaleCanvas component to no longer need the deprecated backingPixelStore value.

4.0.4

2021-02-22

Also issue a warning if container dimensions are zero, not just negative.

4.0.3

2020-11-27

Fixes an issue where it would throw an error if you set a manual domain and data was an empty array.

4.0.2

2020-11-23

Add a warning if you're trying to use domain padding and you have a domain or range that isn't an array with two items.

4.0.1

2020-11-23

The layouts folder got renamed to Layouts. Fix that so imports don't get confused.

4.0.0

2020-11-22

This changes how scale padding works by a) correcting the calculation so that it's actually accurate (before it was off by a little bit for small amounts and a lot for large amounts) and b) adds support so you can use padding for non-linear scales (log, power, symlog etc.).

It's a breaking change but only if you're using xPadding, yPadding or zPadding and even then, it will likely only adjust by a few pixels. Closes #17.

3.1.1

2020-06-19

Remove undefined fields passed into extents prop.

3.1.0

2020-06-17

Create the extents <LayerCake> prop that allows for manually setting extents. This also includes a patch to ignore null and NaN values when calculating extents in addition to undefined. This patch shouldn't be a breaking change since the chart would not have worked if you had those values in your data.

3.0.0

2020-06-15

A number of neat features including support for server-side rendering, the new raise helper for better SVG helpers, defaulting to position: relative for layercake-container, aspect ratios, viewbox options, allowing a cake to be position: absolute;, expose some variables as slot values, adds a defs slot to svg layout components, use the prop config instead of originalSettings and expose range arrays as props.

Breaking changes

Rename WebGL component's contextOptions prop to contextAttributes to reflect the WebGL documentation.

Access the ctx object off of the Canvas component as const ctx = getContext('canvas') instead of const ctx = getContext('ctx'), which was a little confusing.

Rename originalSettings to config

2.0.1

2020-01-26

Add back the 1.x dot files, including an .npmignore

2.0.0

2020-01-23

The Tres Leches edition. Complete rewrite to use Svelte 3! It's now a component based interface and is a lot more intuitive to compose graphics. The API options are pretty much the same. Some notable changes:

  1. reverse range functions are now xReverse instead of reverseX
  2. There's an added z-scale to give more options. Examples in the works.
  3. Domain padding is fixed per #11

1.0.2

2020-01-23

Push to 1.x so that past versions are stable. Prepare for launch of version 2.x. Archive this branch at https://github.com/mhkeller/v1.layercake.

0.4.0

2019-03-26

Add custom ranges and some more tests

0.3.2

2019-03-13

Update dependencies to fix minor lodash security problem

0.3.1

2018-12-23

Some small things

0.3.0

2018-10-20

Change the default behavior of uniques since most frequently we'll want it to transform.

0.2.0

2018-10-20

Add uniques as a helper export.

0.1.2

2018-10-18

Let calcExtents measure extents of string values. Various small tweaks for publication.

0.1.1

2018-10-17

Add to .npmignore.

0.1.0

2018-10-17

Initial release