chore: Removes hard-coded colors from legacy-plugin-chart-sankey (#19493)

* chore: Removes hard-coded colors from legacy-plugin-chart-sankey

* Gets opacity from the theme
This commit is contained in:
Michael S. Molina 2022-04-07 11:50:31 -03:00 committed by GitHub
parent 83c3779a6c
commit 06dee825a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,40 +34,42 @@ SankeyComponent.propTypes = {
}; };
export default styled(SankeyComponent)` export default styled(SankeyComponent)`
.superset-legacy-chart-sankey { ${({ theme }) => `
.node { .superset-legacy-chart-sankey {
rect { .node {
cursor: move; rect {
fill-opacity: 0.9; cursor: move;
shape-rendering: crispEdges; fill-opacity: ${theme.opacity.heavy};
shape-rendering: crispEdges;
}
text {
pointer-events: none;
text-shadow: 0 1px 0 ${theme.colors.grayscale.light5};
font-size: ${theme.typography.sizes.s}px;
}
} }
text { .link {
pointer-events: none; fill: none;
text-shadow: 0 1px 0 #fff; stroke: ${theme.colors.grayscale.dark2};
font-size: ${({ fontSize }) => fontSize}em; stroke-opacity: ${theme.opacity.light};
&:hover {
stroke-opacity: ${theme.opacity.mediumLight};
}
}
.opacity-0 {
opacity: 0;
} }
} }
.link { .sankey-tooltip {
fill: none; position: absolute;
stroke: #000; width: auto;
stroke-opacity: 0.2; background: ${theme.colors.grayscale.light2};
&:hover { padding: ${theme.gridUnit * 3}px;
stroke-opacity: 0.5; font-size: ${theme.typography.sizes.s}px;
} color: ${theme.colors.grayscale.dark2};
border: 1px solid ${theme.colors.grayscale.light5};
text-align: center;
pointer-events: none;
} }
.opacity-0 { `}
opacity: 0;
}
}
.sankey-tooltip {
position: absolute;
width: auto;
background: #ddd;
padding: 10px;
font-size: ${({ fontSize }) => fontSize}em;
color: #000;
border: 1px solid #fff;
text-align: center;
pointer-events: none;
}
`; `;