Skip to content

Commit

Permalink
Merge pull request #207 from mhkeller/index
Browse files Browse the repository at this point in the history
Adds index to accessor functions
  • Loading branch information
mhkeller authored Jun 5, 2024
2 parents 817c67b + 19c74e1 commit 18755c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/helpers/createGetter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function createGetter ([$acc, $scale]) {
return d => {
const val = $acc(d);
return (d, i) => {
const val = $acc(d, i);
if (Array.isArray(val)) {
return val.map(v => $scale(v));
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/lib/calcExtents.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function calcExtents (data, fields) {
min = null;
max = null;
for (j = 0; j < dl; j += 1) {
val = acc(data[j]);
val = acc(data[j], j);
if (Array.isArray(val)) {
const vl = val.length;
for (k = 0; k < vl; k += 1) {
Expand Down

0 comments on commit 18755c7

Please sign in to comment.