Skip to content

Commit

Permalink
Merge pull request #1388 from Datawheel/canon-next-d3plus-override-fix
Browse files Browse the repository at this point in the history
remove shapeConfig override
  • Loading branch information
scespinoza authored Oct 25, 2023
2 parents 0b12bc0 + 99cb1fd commit 66acad2
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions packages/next/cms/components/Viz/Viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,48 +211,6 @@ function Viz(props) {
variables,
// overrides
forceUpdate: false,
shapeConfig: {
...(vizProps.config?.shapeConfig || {}),
stroke: undefined,
Path: {
...(vizProps.config?.shapeConfig?.Path || {}),
// fill: () => "white",
},
Line: {
...(vizProps.config?.shapeConfig?.Line || {}),
stroke(d, i) {
if (this._colorScale) {
const c = this._colorScale(d, i);
if (c !== undefined && c !== null) {
const scale = this._colorScaleClass._colorScale;
const colors = this._colorScaleClass.color();
if (!scale) return colors instanceof Array ? colors[colors.length - 1] : colors;
if (!scale.domain().length) return scale.range()[scale.range().length - 1];
return scale(c);
}
}
const c = this._color(d, i);
return colorAssign(c);
},
labelConfig: {
...(vizProps.config?.shapeConfig?.Line?.labelConfig || {}),
fontColor(d, i) {
if (this._colorScale) {
const c = this._colorScale(d, i);
if (c !== undefined && c !== null) {
const scale = this._colorScaleClass._colorScale;
const colors = this._colorScaleClass.color();
if (!scale) return colors instanceof Array ? colors[colors.length - 1] : colors;
if (!scale.domain().length) return scale.range()[scale.range().length - 1];
return scale(c);
}
}
const c = this._color(d, i);
return colorAssign(c);
},
},
},
},
}}
/>
</div>
Expand Down

0 comments on commit 66acad2

Please sign in to comment.