While trying to extract data from IRENA Renewable power generation costs, i am finding that faceted plots are not supported in an easy manner.
The example plot on page 76

uses linear axes for several facets.
It's possible to extract the x-axes and y-axes as a whole, so as to get non-monotonous pixel value mapping:

But then, the interpolation function for the Axis,
|
if (this._interpolation === Interpolation.LINEAR && this.ticks.length > 1) { |
|
// Works because ticks are sorted by pixel position |
|
var minTick = this.ticks[0]; |
|
var maxTick = this.ticks[this.ticks.length-1]; |
|
var minValue = parseFloat(minTick.value); |
|
var maxValue = parseFloat(maxTick.value); |
|
|
|
return MathUtils.project(pixelPos, minTick.pixel, maxTick.pixel, minValue, maxValue); |
|
} |
will determine the pixel value incorrectly, by combining the first and last facet.
I was wondering whether an easy fix for faceted plots might not be to change only the interpolation function to test for monoticity and if not given only interpolate between the two nearest tick values?
Can try implementing that, if you think that is a good approach.
While trying to extract data from IRENA Renewable power generation costs, i am finding that faceted plots are not supported in an easy manner.
The example plot on page 76

uses linear axes for several facets.
It's possible to extract the x-axes and y-axes as a whole, so as to get non-monotonous pixel value mapping:

But then, the interpolation function for the Axis,
ChartDetective/src/datastructure/chartelements/Axis.tsx
Lines 90 to 98 in 3d59759
will determine the pixel value incorrectly, by combining the first and last facet.
I was wondering whether an easy fix for faceted plots might not be to change only the interpolation function to test for monoticity and if not given only interpolate between the two nearest tick values?
Can try implementing that, if you think that is a good approach.