svelteplot 0.7.1-pr-280.3 → 0.7.1-pr-280.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,13 +24,13 @@ type DensityOptions = {
24
24
  * One-dimensional kernel density estimation
25
25
  */
26
26
  export declare function densityX<T>(args: TransformArg<T>, options: DensityOptions & {
27
- channel: 'y' | 'y1' | 'y2';
27
+ channel?: 'y' | 'y1' | 'y2';
28
28
  }): TransformArg<T>;
29
29
  /**
30
30
  * One-dimensional kernel density estimation
31
31
  */
32
32
  export declare function densityY<T>(args: TransformArg<T>, options: DensityOptions & {
33
- channel: 'x' | 'x1' | 'x2';
33
+ channel?: 'x' | 'x1' | 'x2';
34
34
  }): TransformArg<T>;
35
35
  /**
36
36
  * TODO: Two-dimensional kernel density estimation
@@ -177,6 +177,7 @@ function density1d(independent, { data, ...channels }, options = {}) {
177
177
  [independent]: CHANNELS[independent],
178
178
  [channel]: CHANNELS[densityChannel],
179
179
  ...res,
180
+ sort: [{ channel: CHANNELS[independent], order: 'ascending' }],
180
181
  data: outData
181
182
  };
182
183
  }
@@ -66,8 +66,6 @@ function stackXY(byDim, data, channels, options) {
66
66
  : 'F',
67
67
  [S[byDim]]: resolveChannel(byDim, d, channels)
68
68
  }));
69
- // keep original order of x values
70
- const xOrder = Object.fromEntries(Array.from(new Set(resolvedData.map((d) => d[S[secondDim]]))).map((d, i) => [d, i]));
71
69
  // the final data ends up here
72
70
  const out = [];
73
71
  // first we group the dataset by facets to avoid stacking of rows that are
@@ -79,7 +77,10 @@ function stackXY(byDim, data, channels, options) {
79
77
  // so that series identities remain consistent across the secondary dimension.
80
78
  // This is required for offsets like 'wiggle' and 'inside-out'.
81
79
  let keys;
82
- const groupedBySecondDim = d3Groups(facetData, (d) => d[S[secondDim]]).sort((a, b) => xOrder[a[0]] < xOrder[b[0]] ? -1 : 1);
80
+ const groupedBySecondDim = d3Groups(facetData, (d) => d[S[secondDim]]);
81
+ // .sort((a, b) =>
82
+ // xOrder[a[0]] - xOrder[b[0]]
83
+ // );
83
84
  let stackData;
84
85
  const hasUniqueGroups = groupBy !== true &&
85
86
  groupedBySecondDim.every(([, items]) => {
@@ -146,7 +147,7 @@ function stackXY(byDim, data, channels, options) {
146
147
  // out.push(...newData);
147
148
  }
148
149
  return {
149
- data: out,
150
+ data: out.sort((a, b) => a[INDEX] - b[INDEX]),
150
151
  ...channels,
151
152
  [byDim]: undefined,
152
153
  ...(typeof channels[byDim] === 'string' && !channels[ORIGINAL_NAME_KEYS[byDim]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.7.1-pr-280.3",
3
+ "version": "0.7.1-pr-280.5",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",
@@ -94,6 +94,7 @@
94
94
  "eslint-plugin-svelte": "3.13.0",
95
95
  "jqmath": "^0.4.9",
96
96
  "jsdom": "^27.2.0",
97
+ "log-update": "^7.0.2",
97
98
  "lru-cache": "^11.2.4",
98
99
  "mdast-util-from-markdown": "^2.0.2",
99
100
  "mdast-util-gfm": "^3.1.0",
@@ -109,6 +110,8 @@
109
110
  "svelte-check": "^4.3.4",
110
111
  "svelte-eslint-parser": "1.4.0",
111
112
  "svelte-highlight": "^7.9.0",
113
+ "pixelmatch": "^5.3.0",
114
+ "pngjs": "^7.0.0",
112
115
  "svg-path-parser": "^1.1.0",
113
116
  "temml": "^0.12.1",
114
117
  "topojson-client": "^3.1.0",