{
height: mainProjectionArea.height,
},
() => {
- clearCanvas(ctx);
+ clearCanvas(ctx, 'transparent');
ctx.translate(mainProjectionArea.left, mainProjectionArea.top);
renderRect(
ctx,
{ x: left, y: top, width, height },
- { color: fillColor ?? DEFAULT_FILL_COLOR },
- { width: 0, color: stringToRGB('transparent') },
+ { color: DEFAULT_FILL_COLOR },
+ { width: 0, color: colorToRgba('transparent') },
);
},
);
diff --git a/packages/charts/src/components/tooltip/tooltip.tsx b/packages/charts/src/components/tooltip/tooltip.tsx
index 30234a52221..ff5ea77f02f 100644
--- a/packages/charts/src/components/tooltip/tooltip.tsx
+++ b/packages/charts/src/components/tooltip/tooltip.tsx
@@ -6,13 +6,12 @@
* Side Public License, v 1.
*/
-import chroma from 'chroma-js';
import classNames from 'classnames';
import React, { memo, useCallback, useMemo, useEffect } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';
-import { isColorValid } from '../../common/color_calcs';
+import { colorToRgba } from '../../common/color_library_wrappers';
import { TooltipValueFormatter, TooltipSettings, TooltipValue } from '../../specs';
import { onPointerMove as onPointerMoveAction } from '../../state/actions/mouse';
import { GlobalChartState, BackwardRef } from '../../state/chart_state';
@@ -113,7 +112,8 @@ const TooltipComponent = ({
const classes = classNames('echTooltip__item', {
echTooltip__rowHighlighted: isHighlighted,
});
- const adjustedBGColor = isColorValid(color) && chroma(color).alpha() === 0 ? 'transparent' : backgroundColor;
+
+ const adjustedBGColor = colorToRgba(color)[3] === 0 ? 'transparent' : backgroundColor;
return (
{
/**
- * patern to apply to canvas fill
+ * pattern to apply to canvas fill
*/
pattern: CanvasPattern;
}
@@ -67,7 +57,7 @@ export interface Fill {
/**
* fill color in rgba
*/
- color: RgbObject;
+ color: RgbaTuple;
texture?: Texture;
}
@@ -79,7 +69,7 @@ export interface Stroke {
/**
* stroke rgba
*/
- color: RgbObject;
+ color: RgbaTuple;
/**
* stroke width
*/
diff --git a/packages/charts/src/mocks/geometries.ts b/packages/charts/src/mocks/geometries.ts
index abb49d8bd0f..0da02327cdd 100644
--- a/packages/charts/src/mocks/geometries.ts
+++ b/packages/charts/src/mocks/geometries.ts
@@ -29,20 +29,10 @@ export class MockPointGeometry {
style: {
shape: PointShape.Circle,
fill: {
- color: {
- r: 255,
- g: 255,
- b: 255,
- opacity: 1,
- },
+ color: [255, 255, 255, 1],
},
stroke: {
- color: {
- r: 255,
- g: 0,
- b: 0,
- opacity: 1,
- },
+ color: [255, 0, 0, 1],
width: 1,
},
},
diff --git a/packages/charts/src/renderers/canvas/index.ts b/packages/charts/src/renderers/canvas/index.ts
index c984eb89a7c..b78ef6fee66 100644
--- a/packages/charts/src/renderers/canvas/index.ts
+++ b/packages/charts/src/renderers/canvas/index.ts
@@ -7,6 +7,7 @@
*/
import { Rect } from '../../geoms/types';
+import { Color } from '../../utils/common';
import { ClippedRanges } from '../../utils/geometry';
/** @internal */
@@ -33,10 +34,14 @@ export function withContext(ctx: CanvasRenderingContext2D, fun: CanvasRenderer)
}
/** @internal */
-export function clearCanvas(ctx: CanvasRenderingContext2D) {
+export function clearCanvas(ctx: CanvasRenderingContext2D, bgColor: Color) {
withContext(ctx, () => {
ctx.setTransform(1, 0, 0, 1, 0, 0);
+ // with transparent background, clearRect is required
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ ctx.fillStyle = bgColor;
+ // filling with the background color is required to have a precise text color contrast calculation
+ ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
});
}
diff --git a/packages/charts/src/utils/themes/theme.ts b/packages/charts/src/utils/themes/theme.ts
index f1224c08d4b..448d07e612d 100644
--- a/packages/charts/src/utils/themes/theme.ts
+++ b/packages/charts/src/utils/themes/theme.ts
@@ -341,8 +341,6 @@ export type DisplayValueStyle = Omit & {
| Color
| { color: Color; borderColor?: Color; borderWidth?: number }
| {
- textInvertible: boolean;
- textContrast?: number | boolean;
textBorder?: number;
};
alignment?: {
diff --git a/storybook/stories/bar/51_label_value_advanced.story.tsx b/storybook/stories/bar/51_label_value_advanced.story.tsx
index f7c36a0f467..306f90d0326 100644
--- a/storybook/stories/bar/51_label_value_advanced.story.tsx
+++ b/storybook/stories/bar/51_label_value_advanced.story.tsx
@@ -60,7 +60,7 @@ export const Example = () => {
};
const debug = boolean('debug', false);
- const useInverted = boolean('textInverted', false);
+ const useBorder = boolean('useBorder', false);
const valueColor = color('value color', '#fff');
const borderColor = color('value border color', 'rgba(0,0,0,1)');
const borderSize = number('value border width', 1.5);
@@ -78,9 +78,7 @@ export const Example = () => {
fontFamily: "'Open Sans', Helvetica, Arial, sans-serif",
fontStyle: 'normal',
padding: 0,
- fill: useInverted
- ? { textInvertible: useInverted, textContrast: true, textBorder: borderSize }
- : { color: valueColor, borderColor, borderWidth: borderSize },
+ fill: useBorder ? { textBorder: borderSize } : { color: valueColor, borderColor, borderWidth: borderSize },
offsetX: number('offsetX', 0),
offsetY: number('offsetY', 0),
alignment: {
diff --git a/storybook/stories/interactions/17_png_export.story.tsx b/storybook/stories/interactions/17_png_export.story.tsx
index faebb36e604..b720dac9a41 100644
--- a/storybook/stories/interactions/17_png_export.story.tsx
+++ b/storybook/stories/interactions/17_png_export.story.tsx
@@ -93,7 +93,6 @@ function renderPartitionChart() {
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/mosaic/10_mosaic_simple.story.tsx b/storybook/stories/mosaic/10_mosaic_simple.story.tsx
index 31cf82964c4..452a7443144 100644
--- a/storybook/stories/mosaic/10_mosaic_simple.story.tsx
+++ b/storybook/stories/mosaic/10_mosaic_simple.story.tsx
@@ -116,3 +116,7 @@ export const Example = () => {
);
};
+
+Example.parameters = {
+ background: { default: 'white' },
+};
diff --git a/storybook/stories/mosaic/20_mosaic_with_other.story.tsx b/storybook/stories/mosaic/20_mosaic_with_other.story.tsx
index a790ca9795a..1e26452a111 100644
--- a/storybook/stories/mosaic/20_mosaic_with_other.story.tsx
+++ b/storybook/stories/mosaic/20_mosaic_with_other.story.tsx
@@ -91,3 +91,7 @@ export const Example = () => {
);
};
+
+Example.parameters = {
+ background: { default: 'white' },
+};
diff --git a/storybook/stories/small_multiples/7_sunbursts.story.tsx b/storybook/stories/small_multiples/7_sunbursts.story.tsx
index 92c7b0faba1..b3f6257ede5 100644
--- a/storybook/stories/small_multiples/7_sunbursts.story.tsx
+++ b/storybook/stories/small_multiples/7_sunbursts.story.tsx
@@ -152,7 +152,6 @@ export const Example = () => {
fillLabel: {
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
- textInvertible: true,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/stylings/20_partition_background.story.tsx b/storybook/stories/stylings/20_partition_background.story.tsx
index f5a3820d50a..b9e82fcd597 100644
--- a/storybook/stories/stylings/20_partition_background.story.tsx
+++ b/storybook/stories/stylings/20_partition_background.story.tsx
@@ -30,9 +30,6 @@ export const Example = () => {
color: color('Background color', 'rgba(255, 255, 255, 1)'),
},
};
- const invertTextColors = boolean('invert colors for lightness/darkness', true);
- const toggleTextContrast = boolean('text contrast', true);
-
return (
@@ -75,8 +72,6 @@ export const Example = () => {
fillLabel: {
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
- textInvertible: invertTextColors,
- textContrast: toggleTextContrast,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/stylings/21_partition_labels.story.tsx b/storybook/stories/stylings/21_partition_labels.story.tsx
index 5e66a5f268e..616b1ec9e4c 100644
--- a/storybook/stories/stylings/21_partition_labels.story.tsx
+++ b/storybook/stories/stylings/21_partition_labels.story.tsx
@@ -34,7 +34,6 @@ export const Example = () => {
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true, textContrast: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/10_2_slice.story.tsx b/storybook/stories/sunburst/10_2_slice.story.tsx
index 12e7cb38658..d238c5f0132 100644
--- a/storybook/stories/sunburst/10_2_slice.story.tsx
+++ b/storybook/stories/sunburst/10_2_slice.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/11_small_large.story.tsx b/storybook/stories/sunburst/11_small_large.story.tsx
index d156e36f564..5e25f947f90 100644
--- a/storybook/stories/sunburst/11_small_large.story.tsx
+++ b/storybook/stories/sunburst/11_small_large.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => d,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/12_very_small.story.tsx b/storybook/stories/sunburst/12_very_small.story.tsx
index abc2742ed72..4a13f6d4963 100644
--- a/storybook/stories/sunburst/12_very_small.story.tsx
+++ b/storybook/stories/sunburst/12_very_small.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => d,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/13_empty.story.tsx b/storybook/stories/sunburst/13_empty.story.tsx
index edc487f16ca..c82b9dcd45b 100644
--- a/storybook/stories/sunburst/13_empty.story.tsx
+++ b/storybook/stories/sunburst/13_empty.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/14_full_zero.story.tsx b/storybook/stories/sunburst/14_full_zero.story.tsx
index 45a35038d10..90571d951f1 100644
--- a/storybook/stories/sunburst/14_full_zero.story.tsx
+++ b/storybook/stories/sunburst/14_full_zero.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/15_single.story.tsx b/storybook/stories/sunburst/15_single.story.tsx
index adc561461ec..4831eaf699a 100644
--- a/storybook/stories/sunburst/15_single.story.tsx
+++ b/storybook/stories/sunburst/15_single.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/15_single_sunburst.story.tsx b/storybook/stories/sunburst/15_single_sunburst.story.tsx
index cfc56166939..9d79a2f0d6a 100644
--- a/storybook/stories/sunburst/15_single_sunburst.story.tsx
+++ b/storybook/stories/sunburst/15_single_sunburst.story.tsx
@@ -64,7 +64,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
- textInvertible: true,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/sunburst/16_single_small.story.tsx b/storybook/stories/sunburst/16_single_small.story.tsx
index 1a98068cdb1..ce852dd92cf 100644
--- a/storybook/stories/sunburst/16_single_small.story.tsx
+++ b/storybook/stories/sunburst/16_single_small.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/17_single_very_small.story.tsx b/storybook/stories/sunburst/17_single_very_small.story.tsx
index b8d26af83df..63071aca21b 100644
--- a/storybook/stories/sunburst/17_single_very_small.story.tsx
+++ b/storybook/stories/sunburst/17_single_very_small.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/18_no_sliced.story.tsx b/storybook/stories/sunburst/18_no_sliced.story.tsx
index cf9f2ba24e1..93671691891 100644
--- a/storybook/stories/sunburst/18_no_sliced.story.tsx
+++ b/storybook/stories/sunburst/18_no_sliced.story.tsx
@@ -26,7 +26,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/19_negative.story.tsx b/storybook/stories/sunburst/19_negative.story.tsx
index e79d365a50a..60ad2cf33ce 100644
--- a/storybook/stories/sunburst/19_negative.story.tsx
+++ b/storybook/stories/sunburst/19_negative.story.tsx
@@ -30,7 +30,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/1_simple.story.tsx b/storybook/stories/sunburst/1_simple.story.tsx
index 08829f81954..cd519282a43 100644
--- a/storybook/stories/sunburst/1_simple.story.tsx
+++ b/storybook/stories/sunburst/1_simple.story.tsx
@@ -30,7 +30,6 @@ export const Example = () => {
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/20_total_zero.story.tsx b/storybook/stories/sunburst/20_total_zero.story.tsx
index b9c40020151..665359a6547 100644
--- a/storybook/stories/sunburst/20_total_zero.story.tsx
+++ b/storybook/stories/sunburst/20_total_zero.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/21_high_pie.story.tsx b/storybook/stories/sunburst/21_high_pie.story.tsx
index 7c11b797c03..2e314f45d16 100644
--- a/storybook/stories/sunburst/21_high_pie.story.tsx
+++ b/storybook/stories/sunburst/21_high_pie.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.origin,
nodeLabel: (d: Datum) => countryLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/22_counter_clockwise.story.tsx b/storybook/stories/sunburst/22_counter_clockwise.story.tsx
index a3f183a10ba..57e5a54b8d3 100644
--- a/storybook/stories/sunburst/22_counter_clockwise.story.tsx
+++ b/storybook/stories/sunburst/22_counter_clockwise.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/23_clockwise.story.tsx b/storybook/stories/sunburst/23_clockwise.story.tsx
index d39dc0d53ff..43675b0ae7f 100644
--- a/storybook/stories/sunburst/23_clockwise.story.tsx
+++ b/storybook/stories/sunburst/23_clockwise.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/24_linked_label.story.tsx b/storybook/stories/sunburst/24_linked_label.story.tsx
index 815a8c024ea..7036e099241 100644
--- a/storybook/stories/sunburst/24_linked_label.story.tsx
+++ b/storybook/stories/sunburst/24_linked_label.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/25_no_labels.story.tsx b/storybook/stories/sunburst/25_no_labels.story.tsx
index f2c049c33ff..aa704fb14e0 100644
--- a/storybook/stories/sunburst/25_no_labels.story.tsx
+++ b/storybook/stories/sunburst/25_no_labels.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/26_percentage.story.tsx b/storybook/stories/sunburst/26_percentage.story.tsx
index 0e3d8a6874a..263b94f009a 100644
--- a/storybook/stories/sunburst/26_percentage.story.tsx
+++ b/storybook/stories/sunburst/26_percentage.story.tsx
@@ -65,7 +65,6 @@ export const Example = () => (
fontFamily: 'Arial',
fillLabel: {
fontStyle: 'italic',
- textInvertible: true,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/sunburst/27_heterogeneous_depth.story.tsx b/storybook/stories/sunburst/27_heterogeneous_depth.story.tsx
index 637de29f266..3619a489cbe 100644
--- a/storybook/stories/sunburst/27_heterogeneous_depth.story.tsx
+++ b/storybook/stories/sunburst/27_heterogeneous_depth.story.tsx
@@ -66,7 +66,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
- textInvertible: true,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/sunburst/28_not_a_number.story.tsx b/storybook/stories/sunburst/28_not_a_number.story.tsx
index ef5793c34e4..8de3a4af9bd 100644
--- a/storybook/stories/sunburst/28_not_a_number.story.tsx
+++ b/storybook/stories/sunburst/28_not_a_number.story.tsx
@@ -30,7 +30,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/29_custom_stroke.story.tsx b/storybook/stories/sunburst/29_custom_stroke.story.tsx
index 2cf6e8b9bac..8d7626a8ce7 100644
--- a/storybook/stories/sunburst/29_custom_stroke.story.tsx
+++ b/storybook/stories/sunburst/29_custom_stroke.story.tsx
@@ -34,7 +34,6 @@ export const Example = () => {
{
groupByRollup: (d: Datum) => d.origin,
nodeLabel: (d: Datum) => countryLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/2_value_formatted.story.tsx b/storybook/stories/sunburst/2_value_formatted.story.tsx
index 35dc305ad51..cd05fd0a029 100644
--- a/storybook/stories/sunburst/2_value_formatted.story.tsx
+++ b/storybook/stories/sunburst/2_value_formatted.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
fillLabel: {
- textInvertible: true,
fontWeight: 100,
fontStyle: 'italic',
valueFont: {
diff --git a/storybook/stories/sunburst/30_largest_circle.story.tsx b/storybook/stories/sunburst/30_largest_circle.story.tsx
index c67509e5946..bbd41849291 100644
--- a/storybook/stories/sunburst/30_largest_circle.story.tsx
+++ b/storybook/stories/sunburst/30_largest_circle.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/31_bold_link_value.story.tsx b/storybook/stories/sunburst/31_bold_link_value.story.tsx
index 5a64444a035..6dea62809ee 100644
--- a/storybook/stories/sunburst/31_bold_link_value.story.tsx
+++ b/storybook/stories/sunburst/31_bold_link_value.story.tsx
@@ -27,7 +27,7 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true, valueFont: { fontWeight: 900, fontStyle: 'italic' } },
+ fillLabel: { valueFont: { fontWeight: 900, fontStyle: 'italic' } },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/32_custom_tooltip.story.tsx b/storybook/stories/sunburst/32_custom_tooltip.story.tsx
index fe1d28c766b..296e557794b 100644
--- a/storybook/stories/sunburst/32_custom_tooltip.story.tsx
+++ b/storybook/stories/sunburst/32_custom_tooltip.story.tsx
@@ -80,7 +80,6 @@ export const Example = () => {
},
fontFamily: 'Arial',
fillLabel: {
- textInvertible: true,
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
},
diff --git a/storybook/stories/sunburst/33_ordered_slices.story.tsx b/storybook/stories/sunburst/33_ordered_slices.story.tsx
index 347a78aa584..b4894a48ede 100644
--- a/storybook/stories/sunburst/33_ordered_slices.story.tsx
+++ b/storybook/stories/sunburst/33_ordered_slices.story.tsx
@@ -68,7 +68,6 @@ export const Example = () => {
nodeLabel: (d: any) => d,
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}`,
- textInvertible: true,
fontWeight: 600,
fontStyle: 'italic',
valueFont: {
@@ -86,7 +85,6 @@ export const Example = () => {
nodeLabel: (d: any) => countryLookup[d]?.name ?? d,
sortPredicate: boolean('Move "Other" to end', true) ? sortPredicate : null,
fillLabel: {
- textInvertible: true,
fontWeight: 600,
fontStyle: 'italic',
maxFontSize: 16,
diff --git a/storybook/stories/sunburst/3_value_formatted_2.story.tsx b/storybook/stories/sunburst/3_value_formatted_2.story.tsx
index d1a506d92c7..bc099a076d3 100644
--- a/storybook/stories/sunburst/3_value_formatted_2.story.tsx
+++ b/storybook/stories/sunburst/3_value_formatted_2.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
fillLabel: {
- textInvertible: true,
fontWeight: 100,
fontStyle: 'italic',
valueFont: {
diff --git a/storybook/stories/sunburst/4_fill_labels.story.tsx b/storybook/stories/sunburst/4_fill_labels.story.tsx
index acf6b551685..f23c43531dc 100644
--- a/storybook/stories/sunburst/4_fill_labels.story.tsx
+++ b/storybook/stories/sunburst/4_fill_labels.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/5_donut.story.tsx b/storybook/stories/sunburst/5_donut.story.tsx
index 2e2604ad7c4..5eb417574c3 100644
--- a/storybook/stories/sunburst/5_donut.story.tsx
+++ b/storybook/stories/sunburst/5_donut.story.tsx
@@ -27,7 +27,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/6_pie_chart_labels.story.tsx b/storybook/stories/sunburst/6_pie_chart_labels.story.tsx
index c0d75c8370c..54124f3ca19 100644
--- a/storybook/stories/sunburst/6_pie_chart_labels.story.tsx
+++ b/storybook/stories/sunburst/6_pie_chart_labels.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
// nodeLabel: (d: Datum) => d,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/6_pie_chart_linked_labels.story.tsx b/storybook/stories/sunburst/6_pie_chart_linked_labels.story.tsx
index ab768cae0e1..cf1aade9c15 100644
--- a/storybook/stories/sunburst/6_pie_chart_linked_labels.story.tsx
+++ b/storybook/stories/sunburst/6_pie_chart_linked_labels.story.tsx
@@ -29,7 +29,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
// nodeLabel: (d: Datum) => d,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/7_zero_slice.story.tsx b/storybook/stories/sunburst/7_zero_slice.story.tsx
index c277d1a3ee2..1dcccdc1d02 100644
--- a/storybook/stories/sunburst/7_zero_slice.story.tsx
+++ b/storybook/stories/sunburst/7_zero_slice.story.tsx
@@ -30,7 +30,6 @@ export const Example = () => (
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: indexInterpolatedFillColor(interpolatorCET2s),
},
diff --git a/storybook/stories/sunburst/8_sunburst_two_layers.story.tsx b/storybook/stories/sunburst/8_sunburst_two_layers.story.tsx
index 888fa2bb65c..cf2701d08ae 100644
--- a/storybook/stories/sunburst/8_sunburst_two_layers.story.tsx
+++ b/storybook/stories/sunburst/8_sunburst_two_layers.story.tsx
@@ -59,7 +59,6 @@ export const Example = () => {
},
fontFamily: 'Arial',
fillLabel: {
- textInvertible: true,
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
},
diff --git a/storybook/stories/sunburst/9_sunburst_three_layers.story.tsx b/storybook/stories/sunburst/9_sunburst_three_layers.story.tsx
index 6d14694707a..ef6dee79f71 100644
--- a/storybook/stories/sunburst/9_sunburst_three_layers.story.tsx
+++ b/storybook/stories/sunburst/9_sunburst_three_layers.story.tsx
@@ -68,7 +68,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontStyle: 'italic',
- textInvertible: true,
fontWeight: 900,
valueFont: {
fontFamily: 'Menlo',
diff --git a/storybook/stories/treemap/10_three_layers.story.tsx b/storybook/stories/treemap/10_three_layers.story.tsx
index 603bf0e3d5b..90a519a806f 100644
--- a/storybook/stories/treemap/10_three_layers.story.tsx
+++ b/storybook/stories/treemap/10_three_layers.story.tsx
@@ -46,7 +46,6 @@ export const Example = () => (
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontFamily: 'Helvetica',
textColor: 'black',
- textInvertible: false,
fontWeight: 900,
minFontSize: 2,
maxFontSize: 20,
@@ -61,7 +60,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'black',
- textInvertible: false,
fontWeight: 200,
fontStyle: 'normal',
fontFamily: 'Helvetica',
diff --git a/storybook/stories/treemap/1_one_layer.story.tsx b/storybook/stories/treemap/1_one_layer.story.tsx
index ac3422645b1..2bd9a8f9fdf 100644
--- a/storybook/stories/treemap/1_one_layer.story.tsx
+++ b/storybook/stories/treemap/1_one_layer.story.tsx
@@ -37,7 +37,6 @@ export const Example = () => (
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
fillLabel: {
- textInvertible: true,
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
},
shape: {
diff --git a/storybook/stories/treemap/2_one_layer_2.story.tsx b/storybook/stories/treemap/2_one_layer_2.story.tsx
index 923f79a9d3e..5a646ef4a9e 100644
--- a/storybook/stories/treemap/2_one_layer_2.story.tsx
+++ b/storybook/stories/treemap/2_one_layer_2.story.tsx
@@ -33,7 +33,6 @@ export const Example = () => (
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
fillLabel: {
- textInvertible: true,
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
valueFont: {
fontWeight: 100,
diff --git a/storybook/stories/treemap/3_mid_two.story.tsx b/storybook/stories/treemap/3_mid_two.story.tsx
index 8942cc34c8f..d0714234a49 100644
--- a/storybook/stories/treemap/3_mid_two.story.tsx
+++ b/storybook/stories/treemap/3_mid_two.story.tsx
@@ -39,7 +39,6 @@ export const Example = () => (
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
fontFamily: 'Helvetica',
textColor: 'grey',
- textInvertible: false,
},
shape: { fillColor: 'rgba(0,0,0,0)' },
},
@@ -49,7 +48,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'black',
- textInvertible: false,
fontWeight: 200,
fontStyle: 'normal',
fontFamily: 'Helvetica',
diff --git a/storybook/stories/treemap/4_two_layer_stress.story.tsx b/storybook/stories/treemap/4_two_layer_stress.story.tsx
index d50c1aaa95b..01c3eea80b4 100644
--- a/storybook/stories/treemap/4_two_layer_stress.story.tsx
+++ b/storybook/stories/treemap/4_two_layer_stress.story.tsx
@@ -39,7 +39,6 @@ export const Example = () => (
valueFormatter: () => '',
fontFamily: 'Helvetica',
textColor: 'grey',
- textInvertible: true,
},
shape: {
fillColor: 'rgba(0, 0, 0, 0)',
@@ -51,7 +50,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'black',
- textInvertible: true,
fontWeight: 100,
fontStyle: 'normal',
fontFamily: 'Helvetica',
diff --git a/storybook/stories/treemap/5_multicolor.story.tsx b/storybook/stories/treemap/5_multicolor.story.tsx
index 7d319b16b97..bc4d269dad9 100644
--- a/storybook/stories/treemap/5_multicolor.story.tsx
+++ b/storybook/stories/treemap/5_multicolor.story.tsx
@@ -62,7 +62,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'rgba(60,60,60,1)',
- textInvertible: false,
fontWeight: 100,
fontStyle: 'normal',
fontFamily: 'Din Condensed',
diff --git a/storybook/stories/treemap/6_custom_style.story.tsx b/storybook/stories/treemap/6_custom_style.story.tsx
index 6401adfb71d..9b22b26b707 100644
--- a/storybook/stories/treemap/6_custom_style.story.tsx
+++ b/storybook/stories/treemap/6_custom_style.story.tsx
@@ -53,7 +53,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'rgba(60,60,60,1)',
- textInvertible: false,
fontWeight: 600,
fontStyle: 'normal',
fontFamily: 'Courier New',
diff --git a/storybook/stories/treemap/7_percentage.story.tsx b/storybook/stories/treemap/7_percentage.story.tsx
index 89679adab1b..6cee1cdfacd 100644
--- a/storybook/stories/treemap/7_percentage.story.tsx
+++ b/storybook/stories/treemap/7_percentage.story.tsx
@@ -46,7 +46,6 @@ export const Example = () => (
fontFamily: 'Helvetica',
textColor: 'black',
fontWeight: 100,
- textInvertible: false,
},
shape: { fillColor: 'rgba(0,0,0,0)' },
},
@@ -55,7 +54,6 @@ export const Example = () => (
nodeLabel: (d: any) => countryLookup[d].name,
fillLabel: {
textColor: 'black',
- textInvertible: false,
fontWeight: 200,
fontStyle: 'normal',
fontFamily: 'Helvetica',
diff --git a/storybook/stories/treemap/8_groove_text.story.tsx b/storybook/stories/treemap/8_groove_text.story.tsx
index f83af12bf6f..508f19e9493 100644
--- a/storybook/stories/treemap/8_groove_text.story.tsx
+++ b/storybook/stories/treemap/8_groove_text.story.tsx
@@ -40,7 +40,6 @@ export const Example = () => (
valueFormatter: () => '',
fontFamily: 'Helvetica',
textColor: '#555',
- textInvertible: false,
fontWeight: 100,
padding: {
top: number('group padding top', 0, { range: true, min: 0, max: 20 }),
@@ -60,7 +59,6 @@ export const Example = () => (
fillLabel: {
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
textColor: 'black',
- textInvertible: true,
fontWeight: 200,
fontStyle: 'normal',
fontFamily: 'Helvetica',
diff --git a/storybook/stories/treemap/9_zero_values.story.tsx b/storybook/stories/treemap/9_zero_values.story.tsx
index e6dc93c59b7..cea218cf830 100644
--- a/storybook/stories/treemap/9_zero_values.story.tsx
+++ b/storybook/stories/treemap/9_zero_values.story.tsx
@@ -37,7 +37,6 @@ export const Example = () => (
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
fillLabel: {
- textInvertible: true,
valueFormatter: (d: number) => `${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`,
},
shape: {
diff --git a/storybook/stories/utils/hierarchical_input_utils.tsx b/storybook/stories/utils/hierarchical_input_utils.tsx
index 693b23b017b..95eda9904ba 100644
--- a/storybook/stories/utils/hierarchical_input_utils.tsx
+++ b/storybook/stories/utils/hierarchical_input_utils.tsx
@@ -63,7 +63,6 @@ export const config: RecursivePartial = {
fontFamily: 'Arial',
fillLabel: {
valueFormatter: (d: number) => d,
- textInvertible: true,
fontWeight: 500,
},
margin: { top: 0, bottom: 0, left: 0, right: 0 },
diff --git a/storybook/stories/waffle/1_simple.story.tsx b/storybook/stories/waffle/1_simple.story.tsx
index c35b209a739..c8e01a98a6a 100644
--- a/storybook/stories/waffle/1_simple.story.tsx
+++ b/storybook/stories/waffle/1_simple.story.tsx
@@ -30,7 +30,6 @@ export const Example = () => {
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: (d: ShapeTreeNode) => discreteColor(colorBrewerCategoricalStark9.slice(1))(d.sortIndex),
},
@@ -38,7 +37,6 @@ export const Example = () => {
{
groupByRollup: (d: Datum) => d.sitc1,
nodeLabel: (d: Datum) => productLookup[d].name,
- fillLabel: { textInvertible: true },
shape: {
fillColor: (d: ShapeTreeNode) => discreteColor(colorBrewerCategoricalStark9.slice(1))(d.sortIndex),
},
diff --git a/yarn.lock b/yarn.lock
index 9d9e7a55c3e..45eceb37b91 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5548,7 +5548,7 @@
resolved "https://registry.yarnpkg.com/@types/d3-collection/-/d3-collection-1.0.8.tgz#aa9552c570a96e33c132e0fd20e331f64baa9dd5"
integrity sha512-y5lGlazdc0HNO0F3UUX2DPE7OmYvd9Kcym4hXwrJcNUkDaypR5pX+apuMikl9LfTxKItJsY9KYvzBulpCKyvuQ==
-"@types/d3-color@*", "@types/d3-color@^1.2.2":
+"@types/d3-color@*":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@types/d3-color/-/d3-color-1.2.2.tgz#80cf7cfff7401587b8f89307ba36fe4a576bc7cf"
integrity sha512-6pBxzJ8ZP3dYEQ4YjQ+NVbQaOflfgXq/JbDiS99oLobM2o72uAST4q6yPxHv6FOTCRC/n35ktuo8pvw/S4M7sw==