{
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 30234a5222..ff5ea77f02 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 abb49d8bd0..0da02327cd 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 c984eb89a7..b78ef6fee6 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 f1224c08d4..448d07e612 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 f7c36a0f46..306f90d032 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 faebb36e60..b720dac9a4 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 31cf82964c..452a744314 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 a790ca9795..1e26452a11 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 92c7b0faba..b3f6257ede 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 f5a3820d50..b9e82fcd59 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 5e66a5f268..616b1ec9e4 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 12e7cb3865..d238c5f013 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 d156e36f56..5e25f947f9 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 abc2742ed7..4a13f6d496 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 edc487f16c..c82b9dcd45 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 45a35038d1..90571d951f 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 adc561461e..4831eaf699 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 cfc5616693..9d79a2f0d6 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 1a98068cdb..ce852dd92c 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 b8d26af83d..63071aca21 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 cf9f2ba24e..9367169189 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 e79d365a50..60ad2cf33c 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 08829f8195..cd519282a4 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 b9c4002015..665359a654 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 7c11b797c0..2e314f45d1 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 a3f183a10b..57e5a54b8d 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 d39dc0d53f..43675b0ae7 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 815a8c024e..7036e09924 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 f2c049c33f..aa704fb14e 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 0e3d8a6874..263b94f009 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 637de29f26..3619a489cb 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 ef5793c34e..8de3a4af9b 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 2cf6e8b9ba..8d7626a8ce 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 35dc305ad5..cd05fd0a02 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 c67509e594..bbd4184929 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 5a64444a03..6dea62809e 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 fe1d28c766..296e557794 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 347a78aa58..b4894a48ed 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 d1a506d92c..bc099a076d 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 acf6b55168..f23c43531d 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 2e2604ad7c..5eb417574c 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 c0d75c8370..54124f3ca1 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 ab768cae0e..cf1aade9c1 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 c277d1a3ee..1dcccdc1d0 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 888fa2bb65..cf2701d08a 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 6d14694707..ef6dee79f7 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 603bf0e3d5..90a519a806 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 ac3422645b..2bd9a8f9fd 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 923f79a9d3..5a646ef4a9 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 8942cc34c8..d0714234a4 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 d50c1aaa95..01c3eea80b 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 7d319b16b9..bc4d269dad 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 6401adfb71..9b22b26b70 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 89679adab1..6cee1cdfac 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 f83af12bf6..508f19e949 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 e6dc93c59b..cea218cf83 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 693b23b017..95eda9904b 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 c35b209a73..c8e01a98a6 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 9d9e7a55c3..45eceb37b9 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==