Skip to content

Commit

Permalink
fix for orthogonal color and symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 7, 2022
1 parent 2e43f40 commit 3a5b92a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/marks/dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ export class Dot extends Mark {
const {channels} = this;
const symbolChannel = channels.find(({scale}) => scale === "symbol");
if (symbolChannel) {
const fillChannel = channels.find(({name}) => name === "fill");
const strokeChannel = channels.find(({name}) => name === "stroke");
symbolChannel.hint = {
fill: channels.some(({name}) => name === "fill") ? "color" : this.fill,
stroke: channels.some(({name}) => name === "stroke") ? "color" : this.stroke
fill: fillChannel?.value === symbolChannel.value ? "color" : this.fill,
stroke: strokeChannel?.value === symbolChannel.value ? "color" : this.stroke
};
}
}
Expand Down

0 comments on commit 3a5b92a

Please sign in to comment.