feat: improve color consistency (save all labels) (#19038)

This commit is contained in:
Stephen Liu
2022-03-21 15:20:04 +08:00
committed by GitHub
parent e1d0b83885
commit dc575080d7
68 changed files with 690 additions and 137 deletions

View File

@@ -84,7 +84,7 @@ function computeGraph(links) {
}
function SankeyLoop(element, props) {
const { data, width, height, colorScheme } = props;
const { data, width, height, colorScheme, sliceId } = props;
const color = CategoricalColorNamespace.getScale(colorScheme);
const margin = { ...defaultMargin, ...props.margin };
const innerWidth = width - margin.left - margin.right;
@@ -109,7 +109,7 @@ function SankeyLoop(element, props) {
value / sValue,
)})`,
)
.linkColor(d => color(d.source.name));
.linkColor(d => color(d.source.name, sliceId));
const div = select(element);
div.selectAll('*').remove();