mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: improve color consistency (save all labels) (#19038)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
export default function transformProps(chartProps) {
|
||||
const { width, height, formData, queriesData, margin } = chartProps;
|
||||
const { colorScheme } = formData;
|
||||
const { colorScheme, sliceId } = formData;
|
||||
|
||||
return {
|
||||
width,
|
||||
@@ -26,5 +26,6 @@ export default function transformProps(chartProps) {
|
||||
data: queriesData[0].data,
|
||||
colorScheme,
|
||||
margin,
|
||||
sliceId,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user