diff --git a/src/api/computeRealCentroids.js b/src/api/computeRealCentroids.js index 03e6697..26e3e73 100644 --- a/src/api/computeRealCentroids.js +++ b/src/api/computeRealCentroids.js @@ -1,7 +1,7 @@ -const computeRealCentroids = (dimensions, position) => row => - Object.keys(dimensions).map(d => { +const computeRealCentroids = (config, position) => row => + Object.keys(config.dimensions).map(d => { const x = position(d); - const y = dimensions[d].yscale(row[d]); + const y = config.dimensions[d].yscale(row[d]); return [x, y]; }); diff --git a/src/index.js b/src/index.js index 7eb0c37..2c2f29e 100644 --- a/src/index.js +++ b/src/index.js @@ -153,7 +153,7 @@ const ParCoords = userConfig => { pc.renderMarked.default = renderMarkedDefault(config, pc, ctx, position); pc.renderMarked.queue = renderMarkedQueue(config, markedQueue); - pc.compute_real_centroids = computeRealCentroids(config.dimensions, position); + pc.compute_real_centroids = computeRealCentroids(config, position); pc.shadows = shadows(flags, pc); pc.axisDots = axisDots(config, pc, position); pc.clear = clear(config, pc, ctx, brush);