@thi.ng/viz 0.6.89 → 0.7.0

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-02-19T20:59:58Z
3
+ - **Last updated**: 2025-02-24T12:15:28Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -11,6 +11,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ## [0.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/viz@0.7.0) (2025-02-24)
15
+
16
+ #### 🚀 Features
17
+
18
+ - update BarPlot shape function args ([3037d59](https://github.com/thi-ng/umbrella/commit/3037d59))
19
+ - first arg to provide original full datum
20
+
14
21
  ### [0.6.58](https://github.com/thi-ng/umbrella/tree/@thi.ng/viz@0.6.58) (2024-07-16)
15
22
 
16
23
  #### ♻️ Refactoring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/viz",
3
- "version": "0.6.89",
3
+ "version": "0.7.0",
4
4
  "description": "Declarative, functional & multi-format data visualization toolkit based around @thi.ng/hiccup",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -148,5 +148,5 @@
148
148
  "status": "alpha",
149
149
  "year": 2014
150
150
  },
151
- "gitHead": "2958e6a9881bd9e06de587a2141f6d23c64278db\n"
151
+ "gitHead": "1826dd949f91a56685d345d0cfec9fd3c3e89076\n"
152
152
  }
package/plot/bar.d.ts CHANGED
@@ -5,7 +5,15 @@ export interface BarPlotOpts {
5
5
  interleave: number;
6
6
  offset: number;
7
7
  width: number;
8
- shape: Fn3<number, number[], number[], any>;
8
+ /**
9
+ * Shape function to represent a single bar of the plot. Receives the
10
+ * following arguments:
11
+ *
12
+ * - original datum (i.e. [domain position, value])
13
+ * - mapped point of bar at/near X-axis
14
+ * - mapped point of bar representing its value
15
+ */
16
+ shape: Fn3<number[], number[], number[], any>;
9
17
  }
10
18
  export declare const barPlot: (data: DomainValues, opts?: Partial<BarPlotOpts>) => PlotFn;
11
19
  //# sourceMappingURL=bar.d.ts.map
package/plot/bar.js CHANGED
@@ -14,12 +14,13 @@ const barPlot = (data, opts = {}) => (spec) => {
14
14
  return [
15
15
  "g",
16
16
  { weight: opts.width, ...opts.attribs },
17
- ...map(([x, val]) => {
17
+ ...map((datum) => {
18
+ const [x, val] = datum;
18
19
  const a = mapper([x, y0]);
19
20
  a[0] += offset;
20
21
  const b = mapper([x, val]);
21
22
  b[0] += offset;
22
- return opts.shape(val, a, b);
23
+ return opts.shape(datum, a, b);
23
24
  }, __resolveData(data, spec.xaxis.domain))
24
25
  ];
25
26
  };
package/plot/candle.d.ts CHANGED
@@ -18,5 +18,5 @@ export interface CandleShapeOpts {
18
18
  width: number;
19
19
  }
20
20
  export declare const candlePlot: (data: DomainValues<Candle>, opts?: CandlePlotOpts) => PlotFn;
21
- export declare const candle: (opts?: Partial<CandleShapeOpts>) => (raw: Candle, candle: MappedCandle, x: number, isUp: boolean) => any[];
21
+ export declare const candle: (opts?: Partial<CandleShapeOpts>) => CandleShapeFn;
22
22
  //# sourceMappingURL=candle.d.ts.map