layerchart 0.31.0 → 0.31.2

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.
@@ -2,5 +2,6 @@ export * from './geo';
2
2
  export * from './graph';
3
3
  export * from './hierarchy';
4
4
  export * from './math';
5
+ export * from './pivot';
5
6
  export * from './stack';
6
7
  export * from './ticks';
@@ -2,5 +2,6 @@ export * from './geo';
2
2
  export * from './graph';
3
3
  export * from './hierarchy';
4
4
  export * from './math';
5
+ export * from './pivot';
5
6
  export * from './stack';
6
7
  export * from './ticks';
@@ -1,4 +1,3 @@
1
- export declare function getAccessor(key: string): (d: any) => any;
2
1
  /**
3
2
  * Pivot longer (columns to rows)
4
3
  * - see: https://observablehq.com/d/3ea8d446f5ba96fe
@@ -10,5 +9,3 @@ export declare function pivotLonger(data: any[], columns: string[], name: string
10
9
  * - see: https://github.com/d3/d3-array/issues/142#issuecomment-761861983
11
10
  */
12
11
  export declare function pivotWider(data: any[], column: string, name: string, value: string): any[];
13
- export declare function first(items: any[]): any;
14
- export declare function last(items: any[]): any;
@@ -1,12 +1,4 @@
1
1
  import { group } from 'd3-array';
2
- export function getAccessor(key) {
3
- if (typeof key === 'function') {
4
- return key;
5
- }
6
- else {
7
- return (d) => d[key];
8
- }
9
- }
10
2
  /**
11
3
  * Pivot longer (columns to rows)
12
4
  * - see: https://observablehq.com/d/3ea8d446f5ba96fe
@@ -28,9 +20,3 @@ export function pivotLonger(data, columns, name, value) {
28
20
  export function pivotWider(data, column, name, value) {
29
21
  return Array.from(group(data, (d) => d[column]), ([columnVal, items]) => Object.fromEntries([[column, columnVal]].concat(items.map((d) => [d[name], d[value]]))));
30
22
  }
31
- export function first(items) {
32
- return items[0];
33
- }
34
- export function last(items) {
35
- return items[items.length - 1];
36
- }
package/package.json CHANGED
@@ -4,14 +4,14 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "0.31.0",
7
+ "version": "0.31.2",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.27.1",
10
10
  "@mdi/js": "^7.4.47",
11
11
  "@rollup/plugin-dsv": "^3.0.4",
12
12
  "@sveltejs/adapter-auto": "^3.1.1",
13
- "@sveltejs/kit": "^2.5.0",
14
- "@sveltejs/package": "^2.2.6",
13
+ "@sveltejs/kit": "^2.5.1",
14
+ "@sveltejs/package": "^2.2.7",
15
15
  "@svitejs/changesets-changelog-github-compact": "^1.1.0",
16
16
  "@tailwindcss/typography": "^0.5.10",
17
17
  "@types/d3-array": "^3.2.1",
@@ -46,7 +46,7 @@
46
46
  "rehype-slug": "^6.0.0",
47
47
  "shapefile": "^0.6.6",
48
48
  "solar-calculator": "^0.3.0",
49
- "svelte": "^4.2.10",
49
+ "svelte": "^4.2.12",
50
50
  "svelte-check": "^3.6.4",
51
51
  "svelte-json-tree": "^2.2.0",
52
52
  "svelte-preprocess": "^5.1.3",
@@ -57,7 +57,7 @@
57
57
  "typescript": "^5.3.3",
58
58
  "unist-util-visit": "^5.0.0",
59
59
  "us-atlas": "^3.0.1",
60
- "vite": "^5.1.1"
60
+ "vite": "^5.1.4"
61
61
  },
62
62
  "type": "module",
63
63
  "dependencies": {
@@ -81,9 +81,9 @@
81
81
  "date-fns": "^3.3.1",
82
82
  "layercake": "^8.0.2",
83
83
  "lodash-es": "^4.17.21",
84
- "posthog-js": "^1.105.8",
84
+ "posthog-js": "^1.108.3",
85
85
  "shapefile": "^0.6.6",
86
- "svelte-ux": ">=0.60",
86
+ "svelte-ux": ">=0.60.6",
87
87
  "topojson-client": "^3.1.0"
88
88
  },
89
89
  "peerDependencies": {
@@ -94,6 +94,10 @@
94
94
  ".": {
95
95
  "types": "./dist/index.d.ts",
96
96
  "svelte": "./dist/index.js"
97
+ },
98
+ "./utils/*": {
99
+ "types": "./dist/utils/*.d.ts",
100
+ "svelte": "./dist/utils/*.js"
97
101
  }
98
102
  },
99
103
  "files": [