@redsift/charts 12.4.0 → 12.5.0-muiv6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/BarChart2.js +2 -2
- package/_internal/DataPoint2.js +6 -5
- package/_internal/DataPoint2.js.map +1 -1
- package/_internal/Legend3.js +1 -1
- package/_internal/LineChart2.js +2 -2
- package/_internal/PieChart2.js +2 -2
- package/_internal/ScatterPlot2.js +2 -2
- package/index.js +2 -2
- package/package.json +4 -4
package/_internal/BarChart2.js
CHANGED
|
@@ -2,15 +2,15 @@ import { _ as _objectWithoutProperties, a as _extends, b as _objectSpread2 } fro
|
|
|
2
2
|
import React__default, { forwardRef, useRef, createContext, useContext, useEffect, useMemo } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useTheme, useMessageFormatter, Flexbox, Text, Number as Number$1, isComponent, RedsiftColorGreenD1, RedsiftColorRedD1, RedsiftColorNeutralBlack, useId } from '@redsift/design-system';
|
|
5
|
-
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
6
|
-
import { C as ChartSize, g as getSortingMethod, i as isValidDate, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
7
5
|
import { scaleLinear, sum, scaleBand, scaleOrdinal, extent, scaleUtc, scalePoint, utcParse, scaleLog } from 'd3';
|
|
8
6
|
import styled, { css } from 'styled-components';
|
|
9
7
|
import { C as ChartContainer, a as ChartContainerTitle, b as ChartContainerDescription } from './ChartContainer2.js';
|
|
8
|
+
import { C as ChartSize, g as getSortingMethod, i as isValidDate, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
10
9
|
import { A as Axis, a as AxisVariant, g as getAxisType } from './Axis2.js';
|
|
11
10
|
import { u as useFormatCategoricalData } from './useFormatCategoricalData.js';
|
|
12
11
|
import { a as BarOrientation, B as Bar, b as BarDirection } from './Bar2.js';
|
|
13
12
|
import { L as Legend } from './Legend3.js';
|
|
13
|
+
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
14
14
|
import { L as LegendItem } from './LegendItem2.js';
|
|
15
15
|
|
|
16
16
|
/**
|
package/_internal/DataPoint2.js
CHANGED
|
@@ -79,18 +79,19 @@ const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
79
79
|
}),
|
|
80
80
|
ref: ref,
|
|
81
81
|
id: id,
|
|
82
|
-
$clickable: Boolean(onClick)
|
|
82
|
+
$clickable: Boolean(onClick || href)
|
|
83
83
|
}), children, !showTooltip && !isEmpty ? /*#__PURE__*/React__default.createElement("title", {
|
|
84
84
|
id: `${id}-title`
|
|
85
85
|
}, `${text}: ${data.data.value}`) : null);
|
|
86
|
+
const MaybeAnchor = href !== undefined ? /*#__PURE__*/React__default.createElement(as || 'a', _objectSpread2({
|
|
87
|
+
href
|
|
88
|
+
}, anchorProps), DataPointComponent) : DataPointComponent;
|
|
86
89
|
if (showTooltip) {
|
|
87
90
|
return /*#__PURE__*/React__default.createElement(Tooltip, _extends({
|
|
88
91
|
placement: "right",
|
|
89
92
|
theme: theme,
|
|
90
93
|
delay: 50
|
|
91
|
-
}, tooltipProps), /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null,
|
|
92
|
-
href
|
|
93
|
-
}, anchorProps), DataPointComponent) : DataPointComponent), /*#__PURE__*/React__default.createElement(Tooltip.Content, null, isTooltipCustom ? tooltipDecorator(data, {
|
|
94
|
+
}, tooltipProps), /*#__PURE__*/React__default.createElement(Tooltip.Trigger, null, MaybeAnchor), /*#__PURE__*/React__default.createElement(Tooltip.Content, null, isTooltipCustom ? tooltipDecorator(data, {
|
|
94
95
|
index,
|
|
95
96
|
isSelected: propsIsSelected,
|
|
96
97
|
color: props.color
|
|
@@ -103,7 +104,7 @@ const DataPoint = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
103
104
|
maximumFractionDigits: 2
|
|
104
105
|
}) : null)));
|
|
105
106
|
}
|
|
106
|
-
return
|
|
107
|
+
return MaybeAnchor;
|
|
107
108
|
});
|
|
108
109
|
|
|
109
110
|
export { DataPoint as D, StyledDataPoint as S };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataPoint2.js","sources":["../../src/components/DataPoint/styles.ts","../../src/components/DataPoint/DataPoint.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { animated } from '@react-spring/web';\nimport { StyledDataPointProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDataPoint = styled(animated.g)<StyledDataPointProps>``;\n","import React, { forwardRef, KeyboardEventHandler, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp, Number, Text, useId, useTheme } from '@redsift/design-system';\nimport { Tooltip } from '@redsift/popovers';\n\nimport { DataPointProps } from './types';\nimport { StyledDataPoint } from './styles';\nimport { TooltipVariant } from '../../types';\n\nexport const DataPoint: Comp<DataPointProps<any>, SVGGElement> = forwardRef((props, ref) => {\n const {\n anchorProps: { as, href, ...anchorProps } = {},\n children,\n className,\n data,\n id: propsId,\n index,\n isSelected: propsIsSelected,\n labelDecorator,\n onClick,\n role,\n tooltipDecorator,\n tooltipVariant,\n theme: propsTheme,\n tooltipProps,\n dataset,\n groupedData,\n ...forwardedProps\n } = props;\n\n const [_id] = useId();\n const id = propsId ?? _id;\n\n const theme = useTheme(propsTheme);\n\n const isTooltipCustom = tooltipVariant === TooltipVariant.custom && tooltipDecorator;\n const text = labelDecorator\n ? labelDecorator(data, { index, isSelected: propsIsSelected, color: props.color })\n : data.data.key;\n const hasText = text && tooltipVariant !== TooltipVariant.none;\n const tooltipValue =\n tooltipVariant === TooltipVariant.value\n ? data.data.value\n : tooltipVariant === TooltipVariant.percent && data.data.percent\n ? data.data.percent\n : undefined;\n const hasValue = tooltipValue && [TooltipVariant.value, TooltipVariant.percent].includes(tooltipVariant!);\n const showTooltip = tooltipVariant !== TooltipVariant.none && (hasText || hasValue);\n\n const isEmpty = data.data.value === 0;\n\n const isSelectable = role === 'option';\n const isSelected = isSelectable && propsIsSelected === true;\n const isDeselected = isSelectable && propsIsSelected === false;\n\n const onKeyDown: KeyboardEventHandler<SVGElement> = (event) => {\n if (onClick) {\n event.stopPropagation();\n\n if (event.code === 'Enter' || event.code === 'Space') {\n event.preventDefault();\n onClick(data, dataset);\n }\n }\n };\n\n const DataPointComponent = (\n <StyledDataPoint\n tabIndex={onClick ? 0 : undefined}\n aria-label={\n showTooltip && !isEmpty ? (labelDecorator ? text : `${data.data.key}, ${data.data.value}`) : undefined\n }\n aria-labelledby={!showTooltip && !isEmpty ? `${id}-title` : undefined}\n aria-selected={isSelected ? true : isDeselected ? false : undefined}\n onClick={onClick ? () => onClick(data, dataset) : undefined}\n onKeyDown={onClick ? (event: React.KeyboardEvent<SVGElement>) => onKeyDown(event) : undefined}\n role={role ? role : onClick ? 'button' : href ? undefined : 'img'}\n {...forwardedProps}\n className={classNames(className, `_${index}`, {\n selected: isSelected,\n deselected: isDeselected,\n })}\n ref={ref as RefObject<SVGGElement>}\n id={id}\n $clickable={Boolean(onClick)}\n >\n {children}\n {!showTooltip && !isEmpty ? <title id={`${id}-title`}>{`${text}: ${data.data.value}`}</title> : null}\n </StyledDataPoint>\n );\n\n if (showTooltip) {\n return (\n <Tooltip placement=\"right\" theme={theme} delay={50} {...tooltipProps}>\n <Tooltip.Trigger>\n {href !== undefined\n ? React.createElement(as || 'a', { href, ...anchorProps }, DataPointComponent)\n : DataPointComponent}\n </Tooltip.Trigger>\n <Tooltip.Content>\n {isTooltipCustom ? (\n tooltipDecorator(data, { index, isSelected: propsIsSelected, color: props.color }, dataset, groupedData)\n ) : (\n <Text variant=\"caption\">\n {text}\n {hasText && hasValue ? ' - ' : null}\n {hasValue ? (\n <Number\n value={tooltipValue!}\n type={tooltipVariant === TooltipVariant.percent ? 'percent' : 'decimal'}\n variant=\"caption\"\n maximumFractionDigits={2}\n />\n ) : null}\n </Text>\n )}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n\n return DataPointComponent;\n});\n"],"names":["StyledDataPoint","styled","animated","g","DataPoint","forwardRef","props","ref","anchorProps","as","href","children","className","data","id","propsId","index","isSelected","propsIsSelected","labelDecorator","onClick","role","tooltipDecorator","tooltipVariant","theme","propsTheme","tooltipProps","dataset","groupedData","_objectWithoutProperties","_excluded","forwardedProps","_excluded2","_id","useId","useTheme","isTooltipCustom","TooltipVariant","custom","text","color","key","hasText","none","tooltipValue","value","percent","undefined","hasValue","includes","showTooltip","isEmpty","isSelectable","isDeselected","onKeyDown","event","stopPropagation","code","preventDefault","DataPointComponent","React","createElement","_extends","tabIndex","classNames","selected","deselected","$clickable","Boolean","Tooltip","placement","delay","Trigger","_objectSpread","Content","Text","variant","Number","type","maximumFractionDigits"],"mappings":";;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,eAAe,GAAGC,MAAM,CAACC,EAAQ,CAACC,CAAC,CAAwB,CAAC;;;;ACGlE,MAAMC,SAAiD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC1F,MAAM;AACJC,MAAAA,WAAW,EAAE;QAAEC,EAAE;AAAEC,QAAAA,IAAAA;OAAsB,GAAG,EAAE;MAC9CC,QAAQ;MACRC,SAAS;MACTC,IAAI;AACJC,MAAAA,EAAE,EAAEC,OAAO;MACXC,KAAK;AACLC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,cAAc;MACdC,OAAO;MACPC,IAAI;MACJC,gBAAgB;MAChBC,cAAc;AACdC,MAAAA,KAAK,EAAEC,UAAU;MACjBC,YAAY;MACZC,OAAO;AACPC,MAAAA,WAAAA;AAEF,KAAC,GAAGtB,KAAK;AAjBqBE,IAAAA,WAAW,GAAAqB,wBAAA,CAiBrCvB,KAAK,CAjBPE,WAAW,EAAAsB,SAAA,CAAA;AAgBRC,IAAAA,cAAc,GAAAF,wBAAA,CACfvB,KAAK,EAAA0B,UAAA,CAAA,CAAA;AAET,EAAA,MAAM,CAACC,GAAG,CAAC,GAAGC,KAAK,EAAE,CAAA;EACrB,MAAMpB,EAAE,GAAGC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EC,MAAAA,UAAU,EAAEC,eAAe;MAAEsB,KAAK,EAAElC,KAAK,CAACkC,KAAAA;KAAO,EAAEb,OAAO,EAAEC,WAAW,CAAC,gBAExGgC,cAAA,CAAAC,aAAA,CAACc,IAAI,EAAA;AAACC,MAAAA,OAAO,EAAC,SAAA;AAAS,KAAA,EACpBrC,IAAI,EACJG,OAAO,IAAIM,QAAQ,GAAG,KAAK,GAAG,IAAI,EAClCA,QAAQ,gBACPY,cAAA,CAAAC,aAAA,CAACgB,MAAM,EAAA;AACLhC,MAAAA,KAAK,EAAED,YAAc;MACrBkC,IAAI,EAAEvD,cAAc,KAAKc,cAAc,CAACS,OAAO,GAAG,SAAS,GAAG,SAAU;AACxE8B,MAAAA,OAAO,EAAC,SAAS;AACjBG,MAAAA,qBAAqB,EAAE,CAAA;AAAE,KAC1B,CAAC,GACA,IACA,CAEO,CACV,CAAC,CAAA;AAEd,GAAA;AAEA,EAAA,OAAOpB,kBAAkB,CAAA;AAC3B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"DataPoint2.js","sources":["../../src/components/DataPoint/styles.ts","../../src/components/DataPoint/DataPoint.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { animated } from '@react-spring/web';\nimport { StyledDataPointProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDataPoint = styled(animated.g)<StyledDataPointProps>``;\n","import React, { forwardRef, KeyboardEventHandler, RefObject } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp, Number, Text, useId, useTheme } from '@redsift/design-system';\nimport { Tooltip } from '@redsift/popovers';\n\nimport { DataPointProps } from './types';\nimport { StyledDataPoint } from './styles';\nimport { TooltipVariant } from '../../types';\n\nexport const DataPoint: Comp<DataPointProps<any>, SVGGElement> = forwardRef((props, ref) => {\n const {\n anchorProps: { as, href, ...anchorProps } = {},\n children,\n className,\n data,\n id: propsId,\n index,\n isSelected: propsIsSelected,\n labelDecorator,\n onClick,\n role,\n tooltipDecorator,\n tooltipVariant,\n theme: propsTheme,\n tooltipProps,\n dataset,\n groupedData,\n ...forwardedProps\n } = props;\n\n const [_id] = useId();\n const id = propsId ?? _id;\n\n const theme = useTheme(propsTheme);\n\n const isTooltipCustom = tooltipVariant === TooltipVariant.custom && tooltipDecorator;\n const text = labelDecorator\n ? labelDecorator(data, { index, isSelected: propsIsSelected, color: props.color })\n : data.data.key;\n const hasText = text && tooltipVariant !== TooltipVariant.none;\n const tooltipValue =\n tooltipVariant === TooltipVariant.value\n ? data.data.value\n : tooltipVariant === TooltipVariant.percent && data.data.percent\n ? data.data.percent\n : undefined;\n const hasValue = tooltipValue && [TooltipVariant.value, TooltipVariant.percent].includes(tooltipVariant!);\n const showTooltip = tooltipVariant !== TooltipVariant.none && (hasText || hasValue);\n\n const isEmpty = data.data.value === 0;\n\n const isSelectable = role === 'option';\n const isSelected = isSelectable && propsIsSelected === true;\n const isDeselected = isSelectable && propsIsSelected === false;\n\n const onKeyDown: KeyboardEventHandler<SVGElement> = (event) => {\n if (onClick) {\n event.stopPropagation();\n\n if (event.code === 'Enter' || event.code === 'Space') {\n event.preventDefault();\n onClick(data, dataset);\n }\n }\n };\n\n const DataPointComponent = (\n <StyledDataPoint\n tabIndex={onClick ? 0 : undefined}\n aria-label={\n showTooltip && !isEmpty ? (labelDecorator ? text : `${data.data.key}, ${data.data.value}`) : undefined\n }\n aria-labelledby={!showTooltip && !isEmpty ? `${id}-title` : undefined}\n aria-selected={isSelected ? true : isDeselected ? false : undefined}\n onClick={onClick ? () => onClick(data, dataset) : undefined}\n onKeyDown={onClick ? (event: React.KeyboardEvent<SVGElement>) => onKeyDown(event) : undefined}\n role={role ? role : onClick ? 'button' : href ? undefined : 'img'}\n {...forwardedProps}\n className={classNames(className, `_${index}`, {\n selected: isSelected,\n deselected: isDeselected,\n })}\n ref={ref as RefObject<SVGGElement>}\n id={id}\n $clickable={Boolean(onClick || href)}\n >\n {children}\n {!showTooltip && !isEmpty ? <title id={`${id}-title`}>{`${text}: ${data.data.value}`}</title> : null}\n </StyledDataPoint>\n );\n\n const MaybeAnchor =\n href !== undefined\n ? React.createElement(as || 'a', { href, ...anchorProps }, DataPointComponent)\n : DataPointComponent;\n\n if (showTooltip) {\n return (\n <Tooltip placement=\"right\" theme={theme} delay={50} {...tooltipProps}>\n <Tooltip.Trigger>{MaybeAnchor}</Tooltip.Trigger>\n <Tooltip.Content>\n {isTooltipCustom ? (\n tooltipDecorator(data, { index, isSelected: propsIsSelected, color: props.color }, dataset, groupedData)\n ) : (\n <Text variant=\"caption\">\n {text}\n {hasText && hasValue ? ' - ' : null}\n {hasValue ? (\n <Number\n value={tooltipValue!}\n type={tooltipVariant === TooltipVariant.percent ? 'percent' : 'decimal'}\n variant=\"caption\"\n maximumFractionDigits={2}\n />\n ) : null}\n </Text>\n )}\n </Tooltip.Content>\n </Tooltip>\n );\n }\n\n return MaybeAnchor;\n});\n"],"names":["StyledDataPoint","styled","animated","g","DataPoint","forwardRef","props","ref","anchorProps","as","href","children","className","data","id","propsId","index","isSelected","propsIsSelected","labelDecorator","onClick","role","tooltipDecorator","tooltipVariant","theme","propsTheme","tooltipProps","dataset","groupedData","_objectWithoutProperties","_excluded","forwardedProps","_excluded2","_id","useId","useTheme","isTooltipCustom","TooltipVariant","custom","text","color","key","hasText","none","tooltipValue","value","percent","undefined","hasValue","includes","showTooltip","isEmpty","isSelectable","isDeselected","onKeyDown","event","stopPropagation","code","preventDefault","DataPointComponent","React","createElement","_extends","tabIndex","classNames","selected","deselected","$clickable","Boolean","MaybeAnchor","_objectSpread","Tooltip","placement","delay","Trigger","Content","Text","variant","Number","type","maximumFractionDigits"],"mappings":";;;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,eAAe,GAAGC,MAAM,CAACC,EAAQ,CAACC,CAAC,CAAwB,CAAC;;;;ACGlE,MAAMC,SAAiD,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC1F,MAAM;AACJC,MAAAA,WAAW,EAAE;QAAEC,EAAE;AAAEC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AA,OAAOX,WAAW,CAAA;AACpB,CAAC;;;;"}
|
package/_internal/Legend3.js
CHANGED
|
@@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { sum } from 'd3';
|
|
5
5
|
import { baseContainer, getContainerStylingTransientProps } from '@redsift/design-system';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import { L as LegendVariant } from './legend2.js';
|
|
8
7
|
import { L as LegendItem } from './LegendItem2.js';
|
|
8
|
+
import { L as LegendVariant } from './legend2.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Component style.
|
package/_internal/LineChart2.js
CHANGED
|
@@ -2,15 +2,15 @@ import { _ as _objectWithoutProperties, a as _extends, b as _objectSpread2 } fro
|
|
|
2
2
|
import React__default, { forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useTheme, useMessageFormatter, Flexbox, useId } from '@redsift/design-system';
|
|
5
|
-
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
6
|
-
import { C as ChartSize, g as getSortingMethod, i as isValidDate, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
7
5
|
import styled from 'styled-components';
|
|
8
6
|
import { C as ChartContainer } from './ChartContainer2.js';
|
|
9
7
|
import { scaleLinear, extent, scaleTime, scalePoint, line } from 'd3';
|
|
8
|
+
import { C as ChartSize, g as getSortingMethod, i as isValidDate, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
10
9
|
import { A as Axis, a as AxisVariant } from './Axis2.js';
|
|
11
10
|
import { L as Line } from './Line2.js';
|
|
12
11
|
import { D as Dot, a as DotVariant } from './Dot2.js';
|
|
13
12
|
import { L as Legend } from './Legend3.js';
|
|
13
|
+
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Component's labels variant.
|
package/_internal/PieChart2.js
CHANGED
|
@@ -2,13 +2,13 @@ import { _ as _objectWithoutProperties, a as _extends, b as _objectSpread2 } fro
|
|
|
2
2
|
import React__default, { forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Theme, useTheme, useMessageFormatter, useId } from '@redsift/design-system';
|
|
5
|
-
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
6
|
-
import { C as ChartSize, m as mergeLegends, g as getSortingMethod, a as ColorTheme } from './theme.js';
|
|
7
5
|
import styled, { css } from 'styled-components';
|
|
8
6
|
import { C as ChartContainer } from './ChartContainer2.js';
|
|
9
7
|
import { arc, pie, sum } from 'd3';
|
|
10
8
|
import { e as empty } from './scheme.js';
|
|
9
|
+
import { C as ChartSize, m as mergeLegends, g as getSortingMethod, a as ColorTheme } from './theme.js';
|
|
11
10
|
import { A as Arcs } from './Arcs2.js';
|
|
11
|
+
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
12
12
|
import { u as useFormatCategoricalData } from './useFormatCategoricalData.js';
|
|
13
13
|
import { L as Legend } from './Legend3.js';
|
|
14
14
|
|
|
@@ -2,15 +2,15 @@ import { _ as _objectWithoutProperties, a as _extends, b as _objectSpread2 } fro
|
|
|
2
2
|
import React__default, { useRef, useEffect, useState, forwardRef } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useTheme, useMessageFormatter, Flexbox, Button, Text, useId } from '@redsift/design-system';
|
|
5
|
-
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
6
|
-
import { C as ChartSize, g as getSortingMethod, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
7
5
|
import styled from 'styled-components';
|
|
8
6
|
import { C as ChartContainer } from './ChartContainer2.js';
|
|
9
7
|
import { brush, select, zoom, interpolateRound, scaleLinear, min, extent, descending, scaleSqrt, max } from 'd3';
|
|
8
|
+
import { C as ChartSize, g as getSortingMethod, u as useColor, m as mergeLegends, a as ColorTheme } from './theme.js';
|
|
10
9
|
import { A as Axis, a as AxisVariant } from './Axis2.js';
|
|
11
10
|
import { Popover } from '@redsift/popovers';
|
|
12
11
|
import { D as Dot } from './Dot2.js';
|
|
13
12
|
import { L as Legend } from './Legend3.js';
|
|
13
|
+
import { L as LegendVariant, T as TooltipVariant } from './legend2.js';
|
|
14
14
|
|
|
15
15
|
const getRoundedIntermediaryPoint = (selection, scaleX, scaleY) => {
|
|
16
16
|
if (!selection) {
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { a as LabelVariant, L as LegendVariant, T as TooltipVariant } from './_internal/legend2.js';
|
|
2
|
-
export { C as ChartSize, a as ColorTheme, g as getSortingMethod, i as isValidDate, m as mergeLegends, u as useColor } from './_internal/theme.js';
|
|
3
1
|
export { e as empty, g as getColorScale, m as monochrome, s as scheme, a as successDangerScheme } from './_internal/scheme.js';
|
|
2
|
+
export { C as ChartSize, a as ColorTheme, g as getSortingMethod, i as isValidDate, m as mergeLegends, u as useColor } from './_internal/theme.js';
|
|
4
3
|
export { S as ScatterPlot, c as ScatterPlotLegendVariant, b as ScatterPlotVariant, d as StyledScatterPlot, e as StyledScatterPlotEmptyText, u as useBrush, a as useZoom } from './_internal/ScatterPlot2.js';
|
|
5
4
|
export { u as useFormatCategoricalData } from './_internal/useFormatCategoricalData.js';
|
|
5
|
+
export { a as LabelVariant, L as LegendVariant, T as TooltipVariant } from './_internal/legend2.js';
|
|
6
6
|
export { A as Arc, S as StyledArc } from './_internal/Arc2.js';
|
|
7
7
|
export { A as Arcs, S as StyledArcs } from './_internal/Arcs2.js';
|
|
8
8
|
export { A as Axis, b as AxisPosition, a as AxisVariant, S as StyledAxis, g as getAxisType } from './_internal/Axis2.js';
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"test": "yarn test:unit && yarn test:storybook"
|
|
31
31
|
},
|
|
32
32
|
"types": "index.d.ts",
|
|
33
|
-
"version": "12.
|
|
33
|
+
"version": "12.5.0-muiv6",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/react": "^11.10.4",
|
|
36
36
|
"@emotion/styled": "^11.10.4",
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
"ts-jest": "^29.2.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@redsift/design-system": "^12.
|
|
90
|
-
"@redsift/popovers": "^12.
|
|
89
|
+
"@redsift/design-system": "^12.5.0-0",
|
|
90
|
+
"@redsift/popovers": "^12.5.0-0",
|
|
91
91
|
"react": ">=17",
|
|
92
92
|
"react-dom": ">=17",
|
|
93
93
|
"styled-components": "6.1.19"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "6bc4e23b3f58ae93dac00b38d7315d458e252d92"
|
|
96
96
|
}
|