@semcore/d3-chart 3.47.1 → 3.48.0
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/CHANGELOG.md +8 -0
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +11 -11
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +12 -12
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +17 -12
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +11 -11
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +21 -11
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/BarChart.js +29 -12
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/types/Bar.d.js.map +1 -1
- package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +11 -11
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +12 -12
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +17 -12
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +11 -11
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +21 -11
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/BarChart.js +29 -12
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/types/Bar.d.js.map +1 -1
- package/lib/es6/types/HorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/types/Bar.d.ts +7 -1
- package/lib/types/HorizontalBar.d.ts +10 -0
- package/lib/types/Hover.d.ts +3 -0
- package/lib/types/Tooltip.d.ts +3 -0
- package/lib/types/component/Chart/BarChart.type.d.ts +7 -1
- package/package.json +6 -6
|
@@ -25,23 +25,23 @@ var _Pattern = require("../../../Pattern");
|
|
|
25
25
|
var _utils = require("../../../utils");
|
|
26
26
|
var _excluded = ["color"];
|
|
27
27
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
28
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
29
|
-
"__SLegendItem": "
|
|
30
|
-
"_disabled": "
|
|
31
|
-
"__SPointShape": "
|
|
32
|
-
"_color": "
|
|
33
|
-
"--color": "--
|
|
34
|
-
"_shape_Circle": "
|
|
35
|
-
"_size_l": "
|
|
36
|
-
"_size_m": "
|
|
37
|
-
"_shape_Line": "
|
|
38
|
-
"_shape_Square": "
|
|
39
|
-
"_shape_Pattern": "
|
|
40
|
-
"__SIcon": "
|
|
41
|
-
"__SLabel": "
|
|
42
|
-
"__SAdditionalLabel": "
|
|
43
|
-
"__SCount": "
|
|
44
|
-
"__SPatternSymbol": "
|
|
28
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SLegendItem_ai743_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_ai743_gg_:hover{cursor:pointer}.___SLegendItem_ai743_gg_.__disabled_ai743_gg_:hover{cursor:default}}.___SPointShape_ai743_gg_.__color_ai743_gg_{background-color:var(--color_ai743);margin-right:8px;flex-shrink:0}.___SPointShape_ai743_gg_._shape_Circle_ai743_gg_._size_l_ai743_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_ai743_gg_._shape_Circle_ai743_gg_._size_m_ai743_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_ai743_gg_._shape_Line_ai743_gg_._size_l_ai743_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_ai743_gg_._shape_Line_ai743_gg_._size_m_ai743_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_ai743_gg_._shape_Square_ai743_gg_._size_l_ai743_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_ai743_gg_._shape_Square_ai743_gg_._size_m_ai743_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_ai743_gg_._shape_Pattern_ai743_gg_{background-color:transparent;margin-right:4px}.___SIcon_ai743_gg_{line-height:0;margin-right:4px}.___SIcon_ai743_gg_._size_l_ai743_gg_{margin-top:4px}.___SIcon_ai743_gg_._size_m_ai743_gg_{margin-top:2px}.___SLabel_ai743_gg_{min-width:0}.___SAdditionalLabel_ai743_gg_._size_l_ai743_gg_,.___SCount_ai743_gg_._size_l_ai743_gg_,.___SLabel_ai743_gg_._size_l_ai743_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_ai743_gg_._size_m_ai743_gg_,.___SCount_ai743_gg_._size_m_ai743_gg_,.___SLabel_ai743_gg_._size_m_ai743_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_ai743_gg_,.___SCount_ai743_gg_{margin-left:4px}.___SAdditionalLabel_ai743_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_ai743_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_ai743_gg_._size_l_ai743_gg_::before{margin-top:10px}.___SAdditionalLabel_ai743_gg_._size_m_ai743_gg_::before{margin-top:8px}.___SPatternSymbol_ai743_gg_{transform:scale(.8)}" /*__inner_css_end__*/, "ai743_gg_") /*__reshadow_css_end__*/, {
|
|
29
|
+
"__SLegendItem": "___SLegendItem_ai743_gg_",
|
|
30
|
+
"_disabled": "__disabled_ai743_gg_",
|
|
31
|
+
"__SPointShape": "___SPointShape_ai743_gg_",
|
|
32
|
+
"_color": "__color_ai743_gg_",
|
|
33
|
+
"--color": "--color_ai743",
|
|
34
|
+
"_shape_Circle": "_shape_Circle_ai743_gg_",
|
|
35
|
+
"_size_l": "_size_l_ai743_gg_",
|
|
36
|
+
"_size_m": "_size_m_ai743_gg_",
|
|
37
|
+
"_shape_Line": "_shape_Line_ai743_gg_",
|
|
38
|
+
"_shape_Square": "_shape_Square_ai743_gg_",
|
|
39
|
+
"_shape_Pattern": "_shape_Pattern_ai743_gg_",
|
|
40
|
+
"__SIcon": "___SIcon_ai743_gg_",
|
|
41
|
+
"__SLabel": "___SLabel_ai743_gg_",
|
|
42
|
+
"__SAdditionalLabel": "___SAdditionalLabel_ai743_gg_",
|
|
43
|
+
"__SCount": "___SCount_ai743_gg_",
|
|
44
|
+
"__SPatternSymbol": "___SPatternSymbol_ai743_gg_"
|
|
45
45
|
});
|
|
46
46
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
47
47
|
(0, _inherits2["default"])(LegendItemRoot, _Component);
|
|
@@ -19,12 +19,12 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
19
19
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
20
20
|
var _BaseLegend2 = require("../BaseLegend");
|
|
21
21
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SLegendTable": "
|
|
24
|
-
"_columns-count": "__columns-
|
|
25
|
-
"__SColumnItem": "
|
|
26
|
-
"_size_l": "
|
|
27
|
-
"_size_m": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SLegendTable_1ukwf_gg_.__columns-count_1ukwf_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_1ukwf_gg_._size_l_1ukwf_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_1ukwf_gg_._size_m_1ukwf_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "1ukwf_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SLegendTable": "___SLegendTable_1ukwf_gg_",
|
|
24
|
+
"_columns-count": "__columns-count_1ukwf_gg_",
|
|
25
|
+
"__SColumnItem": "___SColumnItem_1ukwf_gg_",
|
|
26
|
+
"_size_l": "_size_l_1ukwf_gg_",
|
|
27
|
+
"_size_m": "_size_m_1ukwf_gg_"
|
|
28
28
|
});
|
|
29
29
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
30
30
|
(0, _inherits2["default"])(LegendTableRoot, _BaseLegend);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.d.js","names":[],"sources":["../../../src/types/Bar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\nimport { ScaleBand, ScaleLinear } from 'd3-scale';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IBarProps extends BarProps, UnknownProperties {}\nexport type BarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Minimal height\n * @default 2\n */\n hMin?: number;\n /**\n * Bar click handler\n */\n onClick?: (data: { [key: string]: string | number }
|
|
1
|
+
{"version":3,"file":"Bar.d.js","names":[],"sources":["../../../src/types/Bar.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\nimport { ScaleBand, ScaleLinear } from 'd3-scale';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IBarProps extends BarProps, UnknownProperties {}\nexport type BarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Minimal height\n * @default 2\n */\n hMin?: number;\n /**\n * Bar click handler\n */\n onClick?: (\n data: { [key: string]: string | number | Date },\n event: React.SyntheticEvent,\n barIndex: number,\n barKey: string,\n ) => void;\n /** Enables element transparency */\n transparent?: boolean;\n /**\n * The maximum width of each Bar\n */\n maxBarSize?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\n/** @deprecated */\nexport interface IBarContext extends BarContext, UnknownProperties {}\nexport type BarContext = {\n scale: [ScaleBand<any>, ScaleLinear<any, any>];\n /** @deprecated */\n value: unknown;\n /** Index in `data` array */\n index: number;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\n/** @deprecated */\nexport interface IBackgroundProps extends BackgroundProps, UnknownProperties {}\nexport type BackgroundProps = Context & {\n /** Coordinate x */\n x?: number | string;\n /** Coordinate y */\n y?: number | string;\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Width rect */\n width?: number | string;\n /** Height rect */\n height?: number | string;\n};\n\ntype BackgroundContext = Context & {\n /** Index in `data` array */\n index: number;\n};\n\ndeclare const Bar: IntergalacticD3Component<'rect', BarProps, BarContext> & {\n Background: IntergalacticD3Component<'rect', BackgroundProps, BackgroundContext>;\n};\n\nexport default Bar;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalBar.d.js","names":[],"sources":["../../../src/types/HorizontalBar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { BarContext, BackgroundProps } from './Bar';\nimport { IntergalacticD3Component } from './Plot';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IHorizontalBarProps extends HorizontalBarProps, UnknownProperties {}\nexport type HorizontalBarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Enables element transparency */\n transparent?: boolean;\n /**\n * The maximum width of each Bar\n */\n maxBarSize?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\ndeclare const HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext> & {\n Background: IntergalacticD3Component<'rect', BackgroundProps, Context>;\n};\n\nexport default HorizontalBar;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"HorizontalBar.d.js","names":[],"sources":["../../../src/types/HorizontalBar.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { BarContext, BackgroundProps } from './Bar';\nimport { IntergalacticD3Component } from './Plot';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IHorizontalBarProps extends HorizontalBarProps, UnknownProperties {}\nexport type HorizontalBarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /**\n * Bar click handler\n */\n onClick?: (\n data: { [key: string]: string | number | Date },\n event: React.SyntheticEvent,\n barIndex: number,\n barKey: string,\n ) => void;\n /** Enables element transparency */\n transparent?: boolean;\n /**\n * The maximum width of each Bar\n */\n maxBarSize?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\ndeclare const HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext> & {\n Background: IntergalacticD3Component<'rect', BackgroundProps, Context>;\n};\n\nexport default HorizontalBar;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { ReturnEl } from '@semcore/core';\nimport { TooltipTypeBase } from './Tooltip';\nimport { BoxProps } from '@semcore/flex-box';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n } & Omit<BoxProps, 'children'>,\n) => ReturnEl) &\n TooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { ReturnEl } from '@semcore/core';\nimport { TooltipTypeBase } from './Tooltip';\nimport { BoxProps } from '@semcore/flex-box';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n } & Omit<BoxProps, 'children'>,\n) => ReturnEl) &\n TooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import Popper, { PopperProps, PopperTriggerProps } from '@semcore/popper';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ITooltipChartProps extends TooltipChartProps, UnknownProperties {}\nexport type TooltipChartProps = PopperProps &\n PopperTriggerProps &\n Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n };\n\n/** @deprecated */\nexport interface ITooltipChartContext extends TooltipChartContext, UnknownProperties {\n /** Index active value for Axis x */\n xIndex: number | null;\n /** Index active value for Axis y */\n yIndex: number | null;\n}\nexport type TooltipChartContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n};\n\nexport type TooltipTypeBase = {\n Trigger: typeof Popper.Trigger;\n Popper: typeof Popper.Popper;\n Title: typeof Box;\n Dot: IntergalacticD3Component<'div', BoxProps & { color?: string }, TooltipChartContext>;\n Footer: typeof Box;\n};\n\nexport type TooltipType<ChildrenRenderProps = {}, TooltipProps = {}> = (<\n Tag extends Intergalactic.Tag = typeof Box,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<\n Tag,\n TooltipProps,\n ChildrenRenderProps & TooltipChartContext\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<\n Intergalactic.Tag,\n Intergalactic.Tag,\n TooltipProps\n > &\n TooltipTypeBase;\n\n/**\n * @deprecated Consider migration to better typed Bubble.Tooltip, HoverLine.Tooltip,\n * HoverRect.Tooltip, Donut.Tooltip, Radar.Tooltip,\n * ScatterPlot.Tooltip or Venn.Tooltip.\n *\n * Migration examples:\n * 1. `<Tooltip tag={HoverLine}>...</Tooltip>` => `<HoverLine.Tooltip>...</HoverLine.Tooltip>`\n * 2. `<Tooltip tag={HoverRect}>...</Tooltip>` => `<HoverRect.Tooltip>...</HoverRect.Tooltip>`\n * 3. `<Tooltip tag={Radar.Hover}>...</Tooltip>` => `<Radar.Tooltip>...</Radar.Tooltip>`\n * 4. `<Tooltip>...</Tooltip>` => `<Bubble.Tooltip>...</Bubble.Tooltip>`\n * 5. `<Tooltip>...</Tooltip>` => `<Donut.Tooltip>...</Donut.Tooltip>`\n * 6. `<Tooltip>...</Tooltip>` => `<ScatterPlot.Tooltip>...</ScatterPlot.Tooltip>`\n * 7. `<Tooltip>...</Tooltip>` => `<Venn.Tooltip>...</Venn.Tooltip>`\n */\ndeclare const Tooltip: TooltipType;\n\nexport default Tooltip;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import React from 'react';\nimport Popper, { PopperProps, PopperTriggerProps } from '@semcore/popper';\nimport { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ITooltipChartProps extends TooltipChartProps, UnknownProperties {}\nexport type TooltipChartProps = PopperProps &\n PopperTriggerProps &\n Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n };\n\n/** @deprecated */\nexport interface ITooltipChartContext extends TooltipChartContext, UnknownProperties {\n /** Index active value for Axis x */\n xIndex: number | null;\n /** Index active value for Axis y */\n yIndex: number | null;\n}\nexport type TooltipChartContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n};\n\nexport type TooltipTypeBase = {\n Trigger: typeof Popper.Trigger;\n Popper: typeof Popper.Popper;\n Title: typeof Box;\n Dot: IntergalacticD3Component<'div', BoxProps & { color?: string }, TooltipChartContext>;\n Footer: typeof Box;\n};\n\nexport type TooltipType<ChildrenRenderProps = {}, TooltipProps = {}> = (<\n Tag extends Intergalactic.Tag = typeof Box,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<\n Tag,\n TooltipProps,\n ChildrenRenderProps & TooltipChartContext\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<\n Intergalactic.Tag,\n Intergalactic.Tag,\n TooltipProps\n > &\n TooltipTypeBase;\n\n/**\n * @deprecated Consider migration to better typed Bubble.Tooltip, HoverLine.Tooltip,\n * HoverRect.Tooltip, Donut.Tooltip, Radar.Tooltip,\n * ScatterPlot.Tooltip or Venn.Tooltip.\n *\n * Migration examples:\n * 1. `<Tooltip tag={HoverLine}>...</Tooltip>` => `<HoverLine.Tooltip>...</HoverLine.Tooltip>`\n * 2. `<Tooltip tag={HoverRect}>...</Tooltip>` => `<HoverRect.Tooltip>...</HoverRect.Tooltip>`\n * 3. `<Tooltip tag={Radar.Hover}>...</Tooltip>` => `<Radar.Tooltip>...</Radar.Tooltip>`\n * 4. `<Tooltip>...</Tooltip>` => `<Bubble.Tooltip>...</Bubble.Tooltip>`\n * 5. `<Tooltip>...</Tooltip>` => `<Donut.Tooltip>...</Donut.Tooltip>`\n * 6. `<Tooltip>...</Tooltip>` => `<ScatterPlot.Tooltip>...</ScatterPlot.Tooltip>`\n * 7. `<Tooltip>...</Tooltip>` => `<Venn.Tooltip>...</Venn.Tooltip>`\n */\ndeclare const Tooltip: TooltipType;\n\nexport default Tooltip;\n"],"mappings":""}
|
package/lib/es6/Area.js
CHANGED
|
@@ -16,17 +16,17 @@ import { definedData, scaleOfBandwidth, getNullData, definedNullData, interpolat
|
|
|
16
16
|
import AnimatedClipPath from './AnimatedClipPath';
|
|
17
17
|
import { PatternFill } from './Pattern';
|
|
18
18
|
/*__reshadow-styles__:"./style/area.shadow.css"*/
|
|
19
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
20
|
-
"__SArea": "
|
|
21
|
-
"_color": "
|
|
22
|
-
"--color": "--
|
|
23
|
-
"_pattern": "
|
|
24
|
-
"--pattern": "--
|
|
25
|
-
"_transparent": "
|
|
26
|
-
"__SAreaLine": "
|
|
27
|
-
"--duration": "--
|
|
28
|
-
"__SNull": "
|
|
29
|
-
"_hide": "
|
|
19
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SArea_7bbxa_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);fill-opacity:.2}.___SArea_7bbxa_gg_.__color_7bbxa_gg_{fill:var(--color_7bbxa)}.___SArea_7bbxa_gg_.__pattern_7bbxa_gg_{fill:var(--pattern_7bbxa);fill-opacity:.7}.___SArea_7bbxa_gg_.__transparent_7bbxa_gg_{opacity:.3}.___SAreaLine_7bbxa_gg_{stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke-width:3;fill:transparent}.___SAreaLine_7bbxa_gg_.__color_7bbxa_gg_{stroke:var(--color_7bbxa)}.___SAreaLine_7bbxa_gg_.__transparent_7bbxa_gg_{opacity:.3}.___SAreaLine_7bbxa_gg_,.___SArea_7bbxa_gg_{transition-property:d;transition-duration:var(--duration_7bbxa);transition-timing-function:ease-in-out}.___SNull_7bbxa_gg_{fill:transparent;stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf);stroke-dasharray:4}.___SNull_7bbxa_gg_.__hide_7bbxa_gg_{display:none}" /*__inner_css_end__*/, "7bbxa_gg_") /*__reshadow_css_end__*/, {
|
|
20
|
+
"__SArea": "___SArea_7bbxa_gg_",
|
|
21
|
+
"_color": "__color_7bbxa_gg_",
|
|
22
|
+
"--color": "--color_7bbxa",
|
|
23
|
+
"_pattern": "__pattern_7bbxa_gg_",
|
|
24
|
+
"--pattern": "--pattern_7bbxa",
|
|
25
|
+
"_transparent": "__transparent_7bbxa_gg_",
|
|
26
|
+
"__SAreaLine": "___SAreaLine_7bbxa_gg_",
|
|
27
|
+
"--duration": "--duration_7bbxa",
|
|
28
|
+
"__SNull": "___SNull_7bbxa_gg_",
|
|
29
|
+
"_hide": "__hide_7bbxa_gg_"
|
|
30
30
|
});
|
|
31
31
|
var AreaRoot = /*#__PURE__*/function (_Component) {
|
|
32
32
|
_inherits(AreaRoot, _Component);
|
package/lib/es6/Axis.js
CHANGED
|
@@ -12,20 +12,20 @@ import { Component, sstyled } from '@semcore/core';
|
|
|
12
12
|
import createElement from './createElement';
|
|
13
13
|
import { scaleOfBandwidth } from './utils';
|
|
14
14
|
/*__reshadow-styles__:"./style/axis.shadow.css"*/
|
|
15
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
16
|
-
"__SAxis": "
|
|
17
|
-
"_hide": "
|
|
18
|
-
"__STick": "
|
|
19
|
-
"__SGrid": "
|
|
20
|
-
"__STitle": "
|
|
21
|
-
"--transform-origin": "--transform-
|
|
22
|
-
"_position_top": "
|
|
23
|
-
"_position_bottom": "
|
|
24
|
-
"_position_right": "
|
|
25
|
-
"_position_left": "
|
|
26
|
-
"_verticalWritingMode": "
|
|
27
|
-
"_position_custom_0": "
|
|
28
|
-
"_position_custom_1": "
|
|
15
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SAxis_s5cfq_gg_{stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SAxis_s5cfq_gg_.__hide_s5cfq_gg_,.___STick_s5cfq_gg_.__hide_s5cfq_gg_{display:none}.___STick_s5cfq_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-chart-grid-text-label, #6c6e79)}.___SGrid_s5cfq_gg_{fill:transparent;stroke:var(--intergalactic-border-secondary, #e0e1e9)}.___STitle_s5cfq_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-text-hint, #6c6e79);transform-origin:var(--transform-origin_s5cfq)}.___STitle_s5cfq_gg_._position_top_s5cfq_gg_{text-anchor:middle}.___STitle_s5cfq_gg_._position_bottom_s5cfq_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_s5cfq_gg_._position_left_s5cfq_gg_,.___STitle_s5cfq_gg_._position_right_s5cfq_gg_{transform:rotate(-90deg);text-anchor:middle;dominant-baseline:middle}.___STitle_s5cfq_gg_._position_left_s5cfq_gg_.__verticalWritingMode_s5cfq_gg_,.___STitle_s5cfq_gg_._position_right_s5cfq_gg_.__verticalWritingMode_s5cfq_gg_{writing-mode:vertical-rl;transform:none}.___STick_s5cfq_gg_._position_top_s5cfq_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_s5cfq_gg_._position_bottom_s5cfq_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_s5cfq_gg_._position_right_s5cfq_gg_{transform:translateX(16px);text-anchor:start;dominant-baseline:middle}.___STick_s5cfq_gg_._position_left_s5cfq_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_s5cfq_gg_._position_custom_0_s5cfq_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_s5cfq_gg_._position_custom_1_s5cfq_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}" /*__inner_css_end__*/, "s5cfq_gg_") /*__reshadow_css_end__*/, {
|
|
16
|
+
"__SAxis": "___SAxis_s5cfq_gg_",
|
|
17
|
+
"_hide": "__hide_s5cfq_gg_",
|
|
18
|
+
"__STick": "___STick_s5cfq_gg_",
|
|
19
|
+
"__SGrid": "___SGrid_s5cfq_gg_",
|
|
20
|
+
"__STitle": "___STitle_s5cfq_gg_",
|
|
21
|
+
"--transform-origin": "--transform-origin_s5cfq",
|
|
22
|
+
"_position_top": "_position_top_s5cfq_gg_",
|
|
23
|
+
"_position_bottom": "_position_bottom_s5cfq_gg_",
|
|
24
|
+
"_position_right": "_position_right_s5cfq_gg_",
|
|
25
|
+
"_position_left": "_position_left_s5cfq_gg_",
|
|
26
|
+
"_verticalWritingMode": "__verticalWritingMode_s5cfq_gg_",
|
|
27
|
+
"_position_custom_0": "_position_custom_0_s5cfq_gg_",
|
|
28
|
+
"_position_custom_1": "_position_custom_1_s5cfq_gg_"
|
|
29
29
|
});
|
|
30
30
|
var CUSTOM_0 = Symbol('custom_0');
|
|
31
31
|
var CUSTOM_1 = Symbol('custom_1');
|
package/lib/es6/Bar.js
CHANGED
|
@@ -14,16 +14,16 @@ import AnimatedClipPath from './AnimatedClipPath';
|
|
|
14
14
|
import { scaleToBand, roundedPath } from './utils';
|
|
15
15
|
import { PatternFill } from './Pattern';
|
|
16
16
|
/*__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
17
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
18
|
-
"__SBar": "
|
|
19
|
-
"--duration": "--
|
|
20
|
-
"_color": "
|
|
21
|
-
"--color": "--
|
|
22
|
-
"_pattern": "
|
|
23
|
-
"--pattern": "--
|
|
24
|
-
"_hide": "
|
|
25
|
-
"_transparent": "
|
|
26
|
-
"__SBackground": "
|
|
17
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBar_88nsa_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_88nsa);transition-timing-function:ease-in-out}.___SBar_88nsa_gg_.__color_88nsa_gg_{fill:var(--color_88nsa)}.___SBar_88nsa_gg_.__pattern_88nsa_gg_.__color_88nsa_gg_{fill:var(--pattern_88nsa);stroke:var(--color_88nsa);stroke-width:1px}.___SBar_88nsa_gg_.__hide_88nsa_gg_{display:none}.___SBar_88nsa_gg_.__transparent_88nsa_gg_{opacity:.3}.___SBackground_88nsa_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}" /*__inner_css_end__*/, "88nsa_gg_") /*__reshadow_css_end__*/, {
|
|
18
|
+
"__SBar": "___SBar_88nsa_gg_",
|
|
19
|
+
"--duration": "--duration_88nsa",
|
|
20
|
+
"_color": "__color_88nsa_gg_",
|
|
21
|
+
"--color": "--color_88nsa",
|
|
22
|
+
"_pattern": "__pattern_88nsa_gg_",
|
|
23
|
+
"--pattern": "--pattern_88nsa",
|
|
24
|
+
"_hide": "__hide_88nsa_gg_",
|
|
25
|
+
"_transparent": "__transparent_88nsa_gg_",
|
|
26
|
+
"__SBackground": "___SBackground_88nsa_gg_"
|
|
27
27
|
});
|
|
28
28
|
export var MIN_HEIGHT = 2;
|
|
29
29
|
var calcPartBarY = function calcPartBarY(y, minHeight, height) {
|
|
@@ -112,7 +112,7 @@ var BarRoot = /*#__PURE__*/function (_Component) {
|
|
|
112
112
|
var barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];
|
|
113
113
|
var barY = yScale(Math.max((_d$y3 = d[y0]) !== null && _d$y3 !== void 0 ? _d$y3 : 0, height <= hMin && d[y] > 0 ? 0 : d[y])) + offset[1] - calcPartBarY(d[y], hMin, height);
|
|
114
114
|
var handleClick = function handleClick(event) {
|
|
115
|
-
return onClick === null || onClick === void 0 ? void 0 : onClick(d, event);
|
|
115
|
+
return onClick === null || onClick === void 0 ? void 0 : onClick(d, event, i, y);
|
|
116
116
|
};
|
|
117
117
|
var dSvg = getRect({
|
|
118
118
|
x: barX,
|
package/lib/es6/Bar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.js","names":["React","transition","Component","sstyled","uniqueIDEnhancement","createElement","AnimatedClipPath","scaleToBand","roundedPath","PatternFill","style","_sstyled","insert","MIN_HEIGHT","calcPartBarY","y","minHeight","height","Object","is","BarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getBackgroundProps","_props","index","_this$asProps","asProps","x","data","animationBar","_this$asProps2","duration","uid","selectRect","selection","selectAll","concat","selectRectNode","node","getAttribute","attr","componentDidUpdate","componentDidMount","renderBar","d","i","_ref","_d$y","_d$y2","_d$y3","SBar","Element","_this$asProps3","styles","color","resolveColor","y0","scale","hide","offsetProps","offset","r","hMin","widthProps","width","groupKey","onClick","transparent","_this$asProps3$maxBar","maxBarSize","Infinity","patterns","dataHintsHandler","_scale","_slicedToArray","xScale","yScale","absHeight","Math","abs","min","domain","Number","max","bandWidth","bandwidth","barX","barY","handleClick","event","dSvg","getRect","radius","Array","isArray","position","describeGroupedValues","describeValueEntity","specifyDataRowFields","Fragment","cn","undefined","render","_this$asProps4","size","map","bind","attributeName","values","id","_defineProperty","Background","props","_ref2","SBackground","_scale2","yRange","range","_ref3"],"sources":["../../src/Bar.jsx"],"sourcesContent":["import React from 'react';\nimport { transition } from 'd3-transition';\nimport { Component, sstyled } from '@semcore/core';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport createElement from './createElement';\nimport AnimatedClipPath from './AnimatedClipPath';\nimport { scaleToBand, roundedPath } from './utils';\nimport { PatternFill } from './Pattern';\n\nimport style from './style/bar.shadow.css';\n\nexport const MIN_HEIGHT = 2;\n\nconst calcPartBarY = (y, minHeight, height) => {\n // need for the correct rendering of negative values (bar should be under Y-axis)\n if (y <= 0) {\n return Object.is(y, 0) ? minHeight : 0;\n }\n // need for the correct rendering of the minimum positive values\n return height <= minHeight ? minHeight : 0;\n};\n\nclass BarRoot extends Component {\n static displayName = 'Bar';\n static style = style;\n static enhance = [uniqueIDEnhancement()];\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n r: 2,\n hMin: MIN_HEIGHT,\n };\n\n getBackgroundProps(_props, index) {\n const { x, data } = this.asProps;\n return {\n value: data[index][x],\n index,\n };\n }\n\n animationBar() {\n const { duration, uid } = this.asProps;\n const selectRect = transition().selection().selectAll(`#${uid} rect`);\n const selectRectNode = selectRect.node();\n\n if (duration > 0 && selectRectNode && selectRectNode.getAttribute('y') !== '0') {\n selectRect.transition().duration(duration).attr('y', 0);\n }\n }\n\n componentDidUpdate() {\n this.animationBar();\n }\n\n componentDidMount() {\n this.animationBar();\n }\n\n renderBar(d, i) {\n const SBar = this.Element;\n const {\n styles,\n color,\n resolveColor,\n x,\n y,\n y0,\n scale,\n hide,\n offset: offsetProps,\n duration,\n uid,\n r,\n hMin,\n width: widthProps,\n groupKey,\n onClick,\n transparent,\n maxBarSize = Infinity,\n patterns,\n dataHintsHandler,\n } = this.asProps;\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absHeight = Math.abs(\n yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale(d[y0] ?? 0)),\n );\n const height = Number(d[y] - (d[y0] ?? 0)) === 0 ? 0 : Math.max(absHeight, hMin);\n const bandWidth = widthProps || scaleToBand(xScale).bandwidth();\n const width = Math.min(bandWidth, maxBarSize);\n const barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];\n const barY =\n yScale(Math.max(d[y0] ?? 0, height <= hMin && d[y] > 0 ? 0 : d[y])) +\n offset[1] -\n calcPartBarY(d[y], hMin, height);\n const handleClick = (event) => onClick?.(d, event);\n const dSvg = getRect({\n x: barX,\n y: barY,\n width,\n height,\n radius: Array.isArray(r) ? r[i] : r,\n position: d[y] > 0 || Object.is(d[y], 0) ? 'top' : 'bottom',\n });\n\n if (groupKey) {\n dataHintsHandler.describeGroupedValues(groupKey, y);\n } else {\n dataHintsHandler.describeValueEntity(`${i}.${y}`, groupKey ?? d[x]);\n dataHintsHandler.specifyDataRowFields(x, y);\n }\n\n return (\n <React.Fragment key={`bar-${i}`}>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'onClick', 'offset']}\n childrenPosition='above'\n value={d}\n index={i}\n hide={hide}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n color={resolveColor(color)}\n x={barX}\n y={barY}\n width={width}\n height={height}\n d={dSvg}\n onClickCapture={handleClick}\n use:duration={`${duration}ms`}\n transparent={transparent}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n render() {\n const { data, uid, size, duration } = this.asProps;\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <AnimatedClipPath\n duration={duration}\n key={`${uid}-animation`}\n attributeName='y'\n values='100%;0'\n id={uid}\n width={size[0]}\n height={`${size[1]}px`}\n />\n )}\n </>\n );\n }\n}\n\nfunction Background(props) {\n const { Element: SBackground, styles, scale, value } = props;\n\n const [xScale, yScale] = scale;\n const yRange = yScale.range();\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='rect'\n childrenPosition='above'\n width={scaleToBand(xScale).bandwidth()}\n height={yRange[0] - yRange[1]}\n x={xScale(value)}\n y={yRange[1]}\n />,\n );\n}\n\nfunction getRect({ x, y, width, height, radius, position }) {\n if (height < radius) radius = height;\n if (radius) {\n if (position === 'top')\n return roundedPath(x, y, width, height, radius, true, true, false, false);\n return roundedPath(x, y, width, height, radius, false, false, true, true);\n }\n return roundedPath(x, y, width, height, radius);\n}\n\nexport default createElement(BarRoot, { Background });\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,EAAEC,OAAO,QAAQ,eAAe;AAClD,OAAOC,mBAAmB,MAAM,6BAA6B;AAC7D,OAAO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MAAM,GAAGpF,MAAM;EACpC,IAAIoF,MAAM,EAAE;IACV,IAAIG,QAAQ,KAAK,KAAK,EACpB,OAAOhG,WAAW,CAAC4B,CAAC,EAAErB,CAAC,EAAE0D,KAAK,EAAExD,MAAM,EAAEoF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;IAC3E,OAAO7F,WAAW,CAAC4B,CAAC,EAAErB,CAAC,EAAE0D,KAAK,EAAExD,MAAM,EAAEoF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;EAC3E;EACA,OAAO7F,WAAW,CAAC4B,CAAC,EAAErB,CAAC,EAAE0D,KAAK,EAAExD,MAAM,EAAEoF,MAAM,CAAC;AACjD;AAEA,eAAehG,aAAa,CAACe,OAAO,EAAE;EAAEoG,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Bar.js","names":["React","transition","Component","sstyled","uniqueIDEnhancement","createElement","AnimatedClipPath","scaleToBand","roundedPath","PatternFill","style","_sstyled","insert","MIN_HEIGHT","calcPartBarY","y","minHeight","height","Object","is","BarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getBackgroundProps","_props","index","_this$asProps","asProps","x","data","animationBar","_this$asProps2","duration","uid","selectRect","selection","selectAll","concat","selectRectNode","node","getAttribute","attr","componentDidUpdate","componentDidMount","renderBar","d","i","_ref","_d$y","_d$y2","_d$y3","SBar","Element","_this$asProps3","styles","color","resolveColor","y0","scale","hide","offsetProps","offset","r","hMin","widthProps","width","groupKey","onClick","transparent","_this$asProps3$maxBar","maxBarSize","Infinity","patterns","dataHintsHandler","_scale","_slicedToArray","xScale","yScale","absHeight","Math","abs","min","domain","Number","max","bandWidth","bandwidth","barX","barY","handleClick","event","dSvg","getRect","radius","Array","isArray","position","describeGroupedValues","describeValueEntity","specifyDataRowFields","Fragment","cn","undefined","render","_this$asProps4","size","map","bind","attributeName","values","id","_defineProperty","Background","props","_ref2","SBackground","_scale2","yRange","range","_ref3"],"sources":["../../src/Bar.jsx"],"sourcesContent":["import React from 'react';\nimport { transition } from 'd3-transition';\nimport { Component, sstyled } from '@semcore/core';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport createElement from './createElement';\nimport AnimatedClipPath from './AnimatedClipPath';\nimport { scaleToBand, roundedPath } from './utils';\nimport { PatternFill } from './Pattern';\n\nimport style from './style/bar.shadow.css';\n\nexport const MIN_HEIGHT = 2;\n\nconst calcPartBarY = (y, minHeight, height) => {\n // need for the correct rendering of negative values (bar should be under Y-axis)\n if (y <= 0) {\n return Object.is(y, 0) ? minHeight : 0;\n }\n // need for the correct rendering of the minimum positive values\n return height <= minHeight ? minHeight : 0;\n};\n\nclass BarRoot extends Component {\n static displayName = 'Bar';\n static style = style;\n static enhance = [uniqueIDEnhancement()];\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n r: 2,\n hMin: MIN_HEIGHT,\n };\n\n getBackgroundProps(_props, index) {\n const { x, data } = this.asProps;\n return {\n value: data[index][x],\n index,\n };\n }\n\n animationBar() {\n const { duration, uid } = this.asProps;\n const selectRect = transition().selection().selectAll(`#${uid} rect`);\n const selectRectNode = selectRect.node();\n\n if (duration > 0 && selectRectNode && selectRectNode.getAttribute('y') !== '0') {\n selectRect.transition().duration(duration).attr('y', 0);\n }\n }\n\n componentDidUpdate() {\n this.animationBar();\n }\n\n componentDidMount() {\n this.animationBar();\n }\n\n renderBar(d, i) {\n const SBar = this.Element;\n const {\n styles,\n color,\n resolveColor,\n x,\n y,\n y0,\n scale,\n hide,\n offset: offsetProps,\n duration,\n uid,\n r,\n hMin,\n width: widthProps,\n groupKey,\n onClick,\n transparent,\n maxBarSize = Infinity,\n patterns,\n dataHintsHandler,\n } = this.asProps;\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absHeight = Math.abs(\n yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale(d[y0] ?? 0)),\n );\n const height = Number(d[y] - (d[y0] ?? 0)) === 0 ? 0 : Math.max(absHeight, hMin);\n const bandWidth = widthProps || scaleToBand(xScale).bandwidth();\n const width = Math.min(bandWidth, maxBarSize);\n const barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];\n const barY =\n yScale(Math.max(d[y0] ?? 0, height <= hMin && d[y] > 0 ? 0 : d[y])) +\n offset[1] -\n calcPartBarY(d[y], hMin, height);\n const handleClick = (event) => onClick?.(d, event, i, y);\n const dSvg = getRect({\n x: barX,\n y: barY,\n width,\n height,\n radius: Array.isArray(r) ? r[i] : r,\n position: d[y] > 0 || Object.is(d[y], 0) ? 'top' : 'bottom',\n });\n\n if (groupKey) {\n dataHintsHandler.describeGroupedValues(groupKey, y);\n } else {\n dataHintsHandler.describeValueEntity(`${i}.${y}`, groupKey ?? d[x]);\n dataHintsHandler.specifyDataRowFields(x, y);\n }\n\n return (\n <React.Fragment key={`bar-${i}`}>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'onClick', 'offset']}\n childrenPosition='above'\n value={d}\n index={i}\n hide={hide}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n color={resolveColor(color)}\n x={barX}\n y={barY}\n width={width}\n height={height}\n d={dSvg}\n onClickCapture={handleClick}\n use:duration={`${duration}ms`}\n transparent={transparent}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n render() {\n const { data, uid, size, duration } = this.asProps;\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <AnimatedClipPath\n duration={duration}\n key={`${uid}-animation`}\n attributeName='y'\n values='100%;0'\n id={uid}\n width={size[0]}\n height={`${size[1]}px`}\n />\n )}\n </>\n );\n }\n}\n\nfunction Background(props) {\n const { Element: SBackground, styles, scale, value } = props;\n\n const [xScale, yScale] = scale;\n const yRange = yScale.range();\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='rect'\n childrenPosition='above'\n width={scaleToBand(xScale).bandwidth()}\n height={yRange[0] - yRange[1]}\n x={xScale(value)}\n y={yRange[1]}\n />,\n );\n}\n\nfunction getRect({ x, y, width, height, radius, position }) {\n if (height < radius) radius = height;\n if (radius) {\n if (position === 'top')\n return roundedPath(x, y, width, height, radius, true, true, false, false);\n return roundedPath(x, y, width, height, radius, false, false, true, true);\n }\n return roundedPath(x, y, width, height, radius);\n}\n\nexport default createElement(BarRoot, { Background });\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,EAAEC,OAAO,QAAQ,eAAe;AAClD,OAAOC,mBAAmB,MAAM,6BAA6B;AAC7D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClD,SAASC,WAAW,QAAQ,WAAW;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIxC,OAAO,IAAMC,UAAU,GAAG,CAAC;AAE3B,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,CAAC,EAAEC,SAAS,EAAEC,MAAM,EAAK;EAC7C;EACA,IAAIF,CAAC,IAAI,CAAC,EAAE;IACV,OAAOG,MAAM,CAACC,EAAE,CAACJ,CAAC,EAAE,CAAC,CAAC,GAAGC,SAAS,GAAG,CAAC;EACxC;EACA;EACA,OAAOC,MAAM,IAAID,SAAS,GAAGA,SAAS,GAAG,CAAC;AAC5C,CAAC;AAAC,IAEII,OAAO,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,OAAA,EAA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ValueScale, measureText } from './utils';
|
|
|
17
17
|
import Tooltip from './Tooltip';
|
|
18
18
|
import { PatternFill } from './Pattern';
|
|
19
19
|
/*__reshadow-styles__:"./style/bubble.shadow.css"*/
|
|
20
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
21
|
-
"__SBubble": "
|
|
22
|
-
"_color": "
|
|
23
|
-
"--color": "--
|
|
24
|
-
"_pattern": "
|
|
25
|
-
"--pattern": "--
|
|
26
|
-
"_transparent": "
|
|
27
|
-
"__SCenter": "
|
|
28
|
-
"__SLabel": "
|
|
29
|
-
"_position_right": "
|
|
30
|
-
"_position_left": "
|
|
31
|
-
"--duration": "--
|
|
20
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBubble_xayse_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_xayse);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_xayse_gg_:hover{opacity:.8}}.___SBubble_xayse_gg_.__color_xayse_gg_{fill:var(--color_xayse)}.___SBubble_xayse_gg_.__pattern_xayse_gg_.__color_xayse_gg_{fill:var(--pattern_xayse);stroke:var(--color_xayse);stroke-width:1px}.___SBubble_xayse_gg_.__transparent_xayse_gg_{opacity:.3}.___SCenter_xayse_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SCenter_xayse_gg_.__color_xayse_gg_{stroke:var(--color_xayse)}.___SCenter_xayse_gg_.__transparent_xayse_gg_{opacity:.3}.___SLabel_xayse_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLabel_xayse_gg_._position_right_xayse_gg_{text-anchor:end}.___SLabel_xayse_gg_._position_left_xayse_gg_{text-anchor:start}.___SLabel_xayse_gg_.__color_xayse_gg_{fill:var(--color_xayse)}.___SLabel_xayse_gg_.__transparent_xayse_gg_{opacity:.3}" /*__inner_css_end__*/, "xayse_gg_") /*__reshadow_css_end__*/, {
|
|
21
|
+
"__SBubble": "___SBubble_xayse_gg_",
|
|
22
|
+
"_color": "__color_xayse_gg_",
|
|
23
|
+
"--color": "--color_xayse",
|
|
24
|
+
"_pattern": "__pattern_xayse_gg_",
|
|
25
|
+
"--pattern": "--pattern_xayse",
|
|
26
|
+
"_transparent": "__transparent_xayse_gg_",
|
|
27
|
+
"__SCenter": "___SCenter_xayse_gg_",
|
|
28
|
+
"__SLabel": "___SLabel_xayse_gg_",
|
|
29
|
+
"_position_right": "_position_right_xayse_gg_",
|
|
30
|
+
"_position_left": "_position_left_xayse_gg_",
|
|
31
|
+
"--duration": "--duration_xayse"
|
|
32
32
|
});
|
|
33
33
|
var BubbleRoot = /*#__PURE__*/function (_Component) {
|
|
34
34
|
_inherits(BubbleRoot, _Component);
|
package/lib/es6/Donut.js
CHANGED
|
@@ -23,15 +23,15 @@ import { getChartDefaultColorName } from './utils';
|
|
|
23
23
|
import Tooltip from './Tooltip';
|
|
24
24
|
import { PatternFill } from './Pattern';
|
|
25
25
|
/*__reshadow-styles__:"./style/donut.shadow.css"*/
|
|
26
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
27
|
-
"__SPie": "
|
|
28
|
-
"_color": "
|
|
29
|
-
"--color": "--
|
|
30
|
-
"_pattern": "
|
|
31
|
-
"--pattern": "--
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"__SEmptyData": "
|
|
34
|
-
"__SLabel": "
|
|
26
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPie_6it3a_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_6it3a_gg_.__color_6it3a_gg_{fill:var(--color_6it3a)}.___SPie_6it3a_gg_.__pattern_6it3a_gg_.__color_6it3a_gg_{fill:var(--pattern_6it3a);stroke:var(--color_6it3a);stroke-width:1px}.___SPie_6it3a_gg_.__transparent_6it3a_gg_{opacity:.3}.___SEmptyData_6it3a_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_6it3a_gg_.__color_6it3a_gg_{fill:var(--color_6it3a)}.___SLabel_6it3a_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}" /*__inner_css_end__*/, "6it3a_gg_") /*__reshadow_css_end__*/, {
|
|
27
|
+
"__SPie": "___SPie_6it3a_gg_",
|
|
28
|
+
"_color": "__color_6it3a_gg_",
|
|
29
|
+
"--color": "--color_6it3a",
|
|
30
|
+
"_pattern": "__pattern_6it3a_gg_",
|
|
31
|
+
"--pattern": "--pattern_6it3a",
|
|
32
|
+
"_transparent": "__transparent_6it3a_gg_",
|
|
33
|
+
"__SEmptyData": "___SEmptyData_6it3a_gg_",
|
|
34
|
+
"__SLabel": "___SLabel_6it3a_gg_"
|
|
35
35
|
});
|
|
36
36
|
var DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
|
|
37
37
|
function transitionAnglePie(_ref6) {
|
package/lib/es6/Dots.js
CHANGED
|
@@ -7,14 +7,14 @@ import trottle from '@semcore/utils/lib/rafTrottle';
|
|
|
7
7
|
import createElement from './createElement';
|
|
8
8
|
import { eventToPoint, invert, interpolateValue, getChartDefaultColorName } from './utils';
|
|
9
9
|
/*__reshadow-styles__:"./style/dot.shadow.css"*/
|
|
10
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
11
|
-
"__SDot": "
|
|
12
|
-
"_hide": "
|
|
13
|
-
"_color": "
|
|
14
|
-
"--color": "--
|
|
15
|
-
"_transparent": "
|
|
16
|
-
"__SDots": "
|
|
17
|
-
"--duration": "--
|
|
10
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDots_12xzo_gg_ .___SDot_12xzo_gg_{transition-duration:var(--duration_12xzo)}.___SDot_12xzo_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:cx,cy,x,y;transition-timing-function:ease-in-out}.___SDot_12xzo_gg_.__hide_12xzo_gg_{display:none}.___SDot_12xzo_gg_.__color_12xzo_gg_{fill:var(--color_12xzo)}.___SDot_12xzo_gg_.__transparent_12xzo_gg_{opacity:.3}" /*__inner_css_end__*/, "12xzo_gg_") /*__reshadow_css_end__*/, {
|
|
11
|
+
"__SDot": "___SDot_12xzo_gg_",
|
|
12
|
+
"_hide": "__hide_12xzo_gg_",
|
|
13
|
+
"_color": "__color_12xzo_gg_",
|
|
14
|
+
"--color": "--color_12xzo",
|
|
15
|
+
"_transparent": "__transparent_12xzo_gg_",
|
|
16
|
+
"__SDots": "___SDots_12xzo_gg_",
|
|
17
|
+
"--duration": "--duration_12xzo"
|
|
18
18
|
});
|
|
19
19
|
import { PatternSymbol, getPatternSymbolSize } from './Pattern';
|
|
20
20
|
var EXCLUDE_PROPS = ['data', 'scale', 'value', 'display'];
|
package/lib/es6/HorizontalBar.js
CHANGED
|
@@ -13,16 +13,16 @@ import AnimatedClipPath from './AnimatedClipPath';
|
|
|
13
13
|
import { scaleToBand, roundedPath } from './utils';
|
|
14
14
|
import { PatternFill } from './Pattern';
|
|
15
15
|
/*__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
16
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
17
|
-
"__SBar": "
|
|
18
|
-
"--duration": "--
|
|
19
|
-
"_color": "
|
|
20
|
-
"--color": "--
|
|
21
|
-
"_pattern": "
|
|
22
|
-
"--pattern": "--
|
|
23
|
-
"_hide": "
|
|
24
|
-
"_transparent": "
|
|
25
|
-
"__SBackground": "
|
|
16
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBar_88nsa_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_88nsa);transition-timing-function:ease-in-out}.___SBar_88nsa_gg_.__color_88nsa_gg_{fill:var(--color_88nsa)}.___SBar_88nsa_gg_.__pattern_88nsa_gg_.__color_88nsa_gg_{fill:var(--pattern_88nsa);stroke:var(--color_88nsa);stroke-width:1px}.___SBar_88nsa_gg_.__hide_88nsa_gg_{display:none}.___SBar_88nsa_gg_.__transparent_88nsa_gg_{opacity:.3}.___SBackground_88nsa_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}" /*__inner_css_end__*/, "88nsa_gg_") /*__reshadow_css_end__*/, {
|
|
17
|
+
"__SBar": "___SBar_88nsa_gg_",
|
|
18
|
+
"--duration": "--duration_88nsa",
|
|
19
|
+
"_color": "__color_88nsa_gg_",
|
|
20
|
+
"--color": "--color_88nsa",
|
|
21
|
+
"_pattern": "__pattern_88nsa_gg_",
|
|
22
|
+
"--pattern": "--pattern_88nsa",
|
|
23
|
+
"_hide": "__hide_88nsa_gg_",
|
|
24
|
+
"_transparent": "__transparent_88nsa_gg_",
|
|
25
|
+
"__SBackground": "___SBackground_88nsa_gg_"
|
|
26
26
|
});
|
|
27
27
|
export var MIN_WIDTH = 2;
|
|
28
28
|
var calcPartBarX = function calcPartBarX(x, minWidth, width) {
|
|
@@ -77,7 +77,8 @@ var HorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
_this$asProps2$maxBar = _this$asProps2.maxBarSize,
|
|
78
78
|
maxBarSize = _this$asProps2$maxBar === void 0 ? Infinity : _this$asProps2$maxBar,
|
|
79
79
|
resolveColor = _this$asProps2.resolveColor,
|
|
80
|
-
patterns = _this$asProps2.patterns
|
|
80
|
+
patterns = _this$asProps2.patterns,
|
|
81
|
+
onClick = _this$asProps2.onClick;
|
|
81
82
|
var offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
82
83
|
var _scale = _slicedToArray(scale, 2),
|
|
83
84
|
xScale = _scale[0],
|
|
@@ -88,6 +89,9 @@ var HorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
88
89
|
var width = Number(d[x] - ((_d$x2 = d[x0]) !== null && _d$x2 !== void 0 ? _d$x2 : 0)) === 0 ? 0 : Math.max(absWidth, wMin);
|
|
89
90
|
var barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
90
91
|
var barX = xScale(Math.min((_d$x3 = d[x0]) !== null && _d$x3 !== void 0 ? _d$x3 : 0, width <= wMin && d[x] < 0 ? 0 : d[x])) + offset[0] - calcPartBarX(d[x], wMin, width);
|
|
92
|
+
var handleClick = function handleClick(event) {
|
|
93
|
+
return onClick === null || onClick === void 0 ? void 0 : onClick(d, event, i, x);
|
|
94
|
+
};
|
|
91
95
|
var dSvg = getHorizontalRect({
|
|
92
96
|
x: barX,
|
|
93
97
|
y: barY,
|
|
@@ -107,7 +111,7 @@ var HorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
107
111
|
"aria-hidden": true,
|
|
108
112
|
"render": 'path',
|
|
109
113
|
"clipPath": "url(#".concat(uid, ")"),
|
|
110
|
-
"__excludeProps": ['data', 'scale', 'value', 'offset'],
|
|
114
|
+
"__excludeProps": ['data', 'scale', 'value', 'onClick', 'offset'],
|
|
111
115
|
"childrenPosition": 'above',
|
|
112
116
|
"value": d,
|
|
113
117
|
"index": i,
|
|
@@ -120,6 +124,7 @@ var HorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
120
124
|
"width": width,
|
|
121
125
|
"height": height,
|
|
122
126
|
"d": dSvg,
|
|
127
|
+
"onClickCapture": handleClick,
|
|
123
128
|
"use:duration": "".concat(duration, "ms"),
|
|
124
129
|
"onMouseMove": onMouseMove,
|
|
125
130
|
"onMouseLeave": onMouseLeave
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalBar.js","names":["React","Component","sstyled","uniqueIDEnhancement","createElement","AnimatedClipPath","scaleToBand","roundedPath","PatternFill","style","_sstyled","insert","MIN_WIDTH","calcPartBarX","x","minWidth","width","Object","is","HorizontalBarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getBackgroundProps","_props","index","_this$asProps","asProps","data","y","renderBar","d","i","_ref","_d$x","_d$x2","_d$x3","SBar","Element","_this$asProps2","styles","color","x0","scale","hide","offsetProps","offset","uid","duration","r","wMin","heightProps","height","onMouseMove","onMouseLeave","groupKey","transparent","_this$asProps2$maxBar","maxBarSize","Infinity","resolveColor","patterns","_scale","_slicedToArray","xScale","yScale","absWidth","Math","abs","max","domain","bandHeight","bandwidth","min","Number","barY","barX","dSvg","getHorizontalRect","radius","Array","isArray","position","dataHintsHandler","describeGroupedValues","describeValueEntity","concat","Fragment","cn","undefined","render","_this$asProps3","size","map","bind","id","_defineProperty","Background","props","_ref2","SBackground","_scale2","xRange","range","_ref3"],"sources":["../../src/HorizontalBar.jsx"],"sourcesContent":["import React from 'react';\nimport { Component, sstyled } from '@semcore/core';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport createElement from './createElement';\nimport AnimatedClipPath from './AnimatedClipPath';\nimport { scaleToBand, roundedPath } from './utils';\nimport { PatternFill } from './Pattern';\n\nimport style from './style/bar.shadow.css';\n\nexport const MIN_WIDTH = 2;\n\nconst calcPartBarX = (x, minWidth, width) => {\n // need for the correct rendering of negative values\n if (x <= 0) {\n return width <= minWidth ? minWidth : 0;\n }\n // need for the correct rendering of the minimum positive values\n return Object.is(x, 0) ? minWidth : 0;\n};\n\nclass HorizontalBarRoot extends Component {\n static displayName = 'HorizontalBar';\n static enhance = [uniqueIDEnhancement()];\n static style = style;\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n r: 2,\n wMin: MIN_WIDTH,\n };\n\n getBackgroundProps(_props, index) {\n const { data, y } = this.asProps;\n return {\n value: data[index][y],\n index,\n };\n }\n\n renderBar(d, i) {\n const SBar = this.Element;\n const {\n styles,\n color,\n x,\n x0,\n y,\n scale,\n hide,\n offset: offsetProps,\n uid,\n duration,\n r,\n wMin,\n height: heightProps,\n onMouseMove,\n onMouseLeave,\n groupKey,\n transparent,\n maxBarSize = Infinity,\n resolveColor,\n patterns,\n } = this.asProps;\n\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absWidth = Math.abs(\n xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale(d[x0] ?? 0)),\n );\n const bandHeight = heightProps || scaleToBand(yScale).bandwidth();\n const height = Math.min(bandHeight, maxBarSize);\n const width = Number(d[x] - (d[x0] ?? 0)) === 0 ? 0 : Math.max(absWidth, wMin);\n const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];\n const barX =\n xScale(Math.min(d[x0] ?? 0, width <= wMin && d[x] < 0 ? 0 : d[x])) +\n offset[0] -\n calcPartBarX(d[x], wMin, width);\n const dSvg = getHorizontalRect({\n x: barX,\n y: barY,\n width,\n height,\n radius: Array.isArray(r) ? r[i] : r,\n position: d[x] > 0 || Object.is(d[x], 0) ? 'right' : 'left',\n });\n\n if (groupKey) {\n this.asProps.dataHintsHandler.describeGroupedValues(groupKey, x);\n } else {\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);\n }\n\n return (\n <React.Fragment key={`horizontal-bar-${i}`}>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n value={d}\n index={i}\n hide={hide}\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n transparent={transparent}\n x={barX}\n y={barY}\n width={width}\n height={height}\n d={dSvg}\n use:duration={`${duration}ms`}\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n\n render() {\n const { data, uid, size, duration } = this.asProps;\n\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n />\n )}\n </>\n );\n }\n}\n\nfunction Background(props) {\n const { Element: SBackground, styles, scale, value } = props;\n const [xScale, yScale] = scale;\n const xRange = xScale.range();\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='rect'\n childrenPosition='above'\n width={xRange[1] - xRange[0]}\n height={scaleToBand(yScale).bandwidth()}\n x={xRange[0]}\n y={yScale(value)}\n />,\n );\n}\n\nfunction getHorizontalRect({ x, y, width, height, radius, position }) {\n if (width < radius) radius = width;\n if (radius) {\n if (position === 'right')\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n return roundedPath(x, y, width, height, radius, true, false, true, false);\n }\n return roundedPath(x, y, width, height, radius);\n}\n\nexport default createElement(HorizontalBarRoot, { Background });\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,QAAQ,eAAe;AAClD,OAAOC,mBAAmB,MAAM,6BAA6B;AAC7D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClD,SAASC,WAAW,QAAQ,WAAW;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIxC,OAAO,IAAMC,SAAS,GAAG,CAAC;AAE1B,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,CAAC,EAAEC,QAAQ,EAAEC,KAAK,EAAK;EAC3C;EACA,IA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EpB,KAAK,EAAE2C,MAAM,EAAE2B,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;IAC3E,OAAO/E,WAAW,CAACO,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAE2B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;EAC3E;EACA,OAAO/E,WAAW,CAACO,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAE2B,MAAM,CAAC;AACjD;AAEA,eAAelF,aAAa,CAACe,iBAAiB,EAAE;EAAEqF,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"HorizontalBar.js","names":["React","Component","sstyled","uniqueIDEnhancement","createElement","AnimatedClipPath","scaleToBand","roundedPath","PatternFill","style","_sstyled","insert","MIN_WIDTH","calcPartBarX","x","minWidth","width","Object","is","HorizontalBarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getBackgroundProps","_props","index","_this$asProps","asProps","data","y","renderBar","d","i","_ref","_d$x","_d$x2","_d$x3","SBar","Element","_this$asProps2","styles","color","x0","scale","hide","offsetProps","offset","uid","duration","r","wMin","heightProps","height","onMouseMove","onMouseLeave","groupKey","transparent","_this$asProps2$maxBar","maxBarSize","Infinity","resolveColor","patterns","onClick","_scale","_slicedToArray","xScale","yScale","absWidth","Math","abs","max","domain","bandHeight","bandwidth","min","Number","barY","barX","handleClick","event","dSvg","getHorizontalRect","radius","Array","isArray","position","dataHintsHandler","describeGroupedValues","describeValueEntity","concat","Fragment","cn","undefined","render","_this$asProps3","size","map","bind","id","_defineProperty","Background","props","_ref2","SBackground","_scale2","xRange","range","_ref3"],"sources":["../../src/HorizontalBar.jsx"],"sourcesContent":["import React from 'react';\nimport { Component, sstyled } from '@semcore/core';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport createElement from './createElement';\nimport AnimatedClipPath from './AnimatedClipPath';\nimport { scaleToBand, roundedPath } from './utils';\nimport { PatternFill } from './Pattern';\n\nimport style from './style/bar.shadow.css';\n\nexport const MIN_WIDTH = 2;\n\nconst calcPartBarX = (x, minWidth, width) => {\n // need for the correct rendering of negative values\n if (x <= 0) {\n return width <= minWidth ? minWidth : 0;\n }\n // need for the correct rendering of the minimum positive values\n return Object.is(x, 0) ? minWidth : 0;\n};\n\nclass HorizontalBarRoot extends Component {\n static displayName = 'HorizontalBar';\n static enhance = [uniqueIDEnhancement()];\n static style = style;\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n r: 2,\n wMin: MIN_WIDTH,\n };\n\n getBackgroundProps(_props, index) {\n const { data, y } = this.asProps;\n return {\n value: data[index][y],\n index,\n };\n }\n\n renderBar(d, i) {\n const SBar = this.Element;\n const {\n styles,\n color,\n x,\n x0,\n y,\n scale,\n hide,\n offset: offsetProps,\n uid,\n duration,\n r,\n wMin,\n height: heightProps,\n onMouseMove,\n onMouseLeave,\n groupKey,\n transparent,\n maxBarSize = Infinity,\n resolveColor,\n patterns,\n onClick,\n } = this.asProps;\n\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absWidth = Math.abs(\n xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale(d[x0] ?? 0)),\n );\n const bandHeight = heightProps || scaleToBand(yScale).bandwidth();\n const height = Math.min(bandHeight, maxBarSize);\n const width = Number(d[x] - (d[x0] ?? 0)) === 0 ? 0 : Math.max(absWidth, wMin);\n const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];\n const barX =\n xScale(Math.min(d[x0] ?? 0, width <= wMin && d[x] < 0 ? 0 : d[x])) +\n offset[0] -\n calcPartBarX(d[x], wMin, width);\n const handleClick = (event) => onClick?.(d, event, i, x);\n const dSvg = getHorizontalRect({\n x: barX,\n y: barY,\n width,\n height,\n radius: Array.isArray(r) ? r[i] : r,\n position: d[x] > 0 || Object.is(d[x], 0) ? 'right' : 'left',\n });\n\n if (groupKey) {\n this.asProps.dataHintsHandler.describeGroupedValues(groupKey, x);\n } else {\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);\n }\n\n return (\n <React.Fragment key={`horizontal-bar-${i}`}>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'onClick', 'offset']}\n childrenPosition='above'\n value={d}\n index={i}\n hide={hide}\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n transparent={transparent}\n x={barX}\n y={barY}\n width={width}\n height={height}\n d={dSvg}\n onClickCapture={handleClick}\n use:duration={`${duration}ms`}\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n\n render() {\n const { data, uid, size, duration } = this.asProps;\n\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n />\n )}\n </>\n );\n }\n}\n\nfunction Background(props) {\n const { Element: SBackground, styles, scale, value } = props;\n const [xScale, yScale] = scale;\n const xRange = xScale.range();\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='rect'\n childrenPosition='above'\n width={xRange[1] - xRange[0]}\n height={scaleToBand(yScale).bandwidth()}\n x={xRange[0]}\n y={yScale(value)}\n />,\n );\n}\n\nfunction getHorizontalRect({ x, y, width, height, radius, position }) {\n if (width < radius) radius = width;\n if (radius) {\n if (position === 'right')\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n return roundedPath(x, y, width, height, radius, true, false, true, false);\n }\n return roundedPath(x, y, width, height, radius);\n}\n\nexport default createElement(HorizontalBarRoot, {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.js
CHANGED
|
@@ -16,9 +16,9 @@ import trottle from '@semcore/utils/lib/rafTrottle';
|
|
|
16
16
|
import createElement from './createElement';
|
|
17
17
|
import { scaleOfBandwidth, getIndexFromData, eventToPoint, invert, scaleToBand } from './utils';
|
|
18
18
|
/*__reshadow-styles__:"./style/hover.shadow.css"*/
|
|
19
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
20
|
-
"__SHoverLine": "
|
|
21
|
-
"__SHoverRect": "
|
|
19
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SHoverLine_7uceg_gg_{stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SHoverRect_7uceg_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}" /*__inner_css_end__*/, "7uceg_gg_") /*__reshadow_css_end__*/, {
|
|
20
|
+
"__SHoverLine": "___SHoverLine_7uceg_gg_",
|
|
21
|
+
"__SHoverRect": "___SHoverRect_7uceg_gg_"
|
|
22
22
|
});
|
|
23
23
|
import Tooltip from './Tooltip';
|
|
24
24
|
var Hover = /*#__PURE__*/function (_Component) {
|