@semcore/d3-chart 3.14.1 → 3.15.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 -1
- package/lib/cjs/Area.js +9 -9
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +14 -11
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +10 -10
- package/lib/cjs/Donut.js +7 -7
- package/lib/cjs/Dots.js +10 -10
- package/lib/cjs/GroupBar.js +19 -7
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +14 -11
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +93 -32
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +17 -17
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/ReferenceLine.js +9 -9
- package/lib/cjs/ScatterPlot.js +7 -7
- package/lib/cjs/StackBar.js +8 -4
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/Tooltip.js +8 -8
- package/lib/cjs/Venn.js +7 -7
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +3 -3
- package/lib/cjs/style/line.shadow.css +11 -0
- package/lib/cjs/types/Bar.d.js.map +1 -1
- package/lib/cjs/types/GroupBar.d.js.map +1 -1
- package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/StackBar.d.js.map +1 -1
- package/lib/es6/Area.js +9 -9
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +14 -11
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +10 -10
- package/lib/es6/Donut.js +7 -7
- package/lib/es6/Dots.js +10 -10
- package/lib/es6/GroupBar.js +19 -7
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +14 -11
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +93 -33
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +17 -17
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/ReferenceLine.js +9 -9
- package/lib/es6/ScatterPlot.js +7 -7
- package/lib/es6/StackBar.js +8 -4
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/Tooltip.js +8 -8
- package/lib/es6/Venn.js +7 -7
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +3 -3
- package/lib/es6/style/line.shadow.css +11 -0
- package/lib/es6/types/Bar.d.js.map +1 -1
- package/lib/es6/types/GroupBar.d.js.map +1 -1
- package/lib/es6/types/HorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/StackBar.d.js.map +1 -1
- package/lib/types/Bar.d.ts +6 -0
- package/lib/types/GroupBar.d.ts +5 -0
- package/lib/types/HorizontalBar.d.ts +4 -0
- package/lib/types/Line.d.ts +13 -1
- package/lib/types/StackBar.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupBar.d.js","names":[],"sources":["../../../src/types/GroupBar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { BarContext, BarProps } from './Bar';\nimport { HorizontalBarProps } from './HorizontalBar';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IGroupBarProps extends GroupBarProps, UnknownProperties {}\nexport type GroupBarProps = 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 /** Scale for group bars */\n /** @deprecated */\n scaleGroup?: any;\n};\n\ndeclare const GroupBar: IntergalacticD3Component<'g', GroupBarProps> & {\n Bar: IntergalacticD3Component<'path', BarProps>;\n HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext>;\n};\n\nexport default GroupBar;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"GroupBar.d.js","names":[],"sources":["../../../src/types/GroupBar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { BarContext, BarProps } from './Bar';\nimport { HorizontalBarProps } from './HorizontalBar';\nimport { Context } from './context';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IGroupBarProps extends GroupBarProps, UnknownProperties {}\nexport type GroupBarProps = 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 /** Scale for group bars */\n /** @deprecated */\n scaleGroup?: any;\n\n /**\n * The maximum width of each Bar\n */\n maxBarSize?: number;\n};\n\ndeclare const GroupBar: IntergalacticD3Component<'g', GroupBarProps> & {\n Bar: IntergalacticD3Component<'path', BarProps>;\n HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext>;\n};\n\nexport default GroupBar;\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';\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 * @default '#50aef4'*/\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\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 { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { BarContext, BackgroundProps } from './Bar';\nimport { IntergalacticD3Component } from './Plot';\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 * @default '#50aef4'*/\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};\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":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = 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 * @default '#50aef4'*/\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n};\n\nexport default Line;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { curveCardinal, CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = 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 * @default '#50aef4'*/\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` array for y1 point by the YAxis for the Area\n */\n y1: string;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackBar.d.js","names":[],"sources":["../../../src/types/StackBar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { BarContext, BarProps } from './Bar';\nimport { HorizontalBarProps } from './HorizontalBar';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IStackBarProps extends StackBarProps, UnknownProperties {}\nexport type StackBarProps = 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 /** Stack generators\n * @default d3.stack() */\n /** @deprecated */\n stack?: any;\n};\n\n/** @deprecated */\nexport interface IStackBarContext extends StackBarContext, UnknownProperties {}\nexport type StackBarContext = {\n /** Series is an array of points, where each point corresponds to the element in the input data. */\n /** @deprecated */\n series: any[];\n};\n\ndeclare const StackBar: IntergalacticD3Component<'g', StackBarProps, StackBarContext> & {\n Bar: IntergalacticD3Component<'path', BarProps, BarContext>;\n HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext>;\n};\n\nexport default StackBar;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"StackBar.d.js","names":[],"sources":["../../../src/types/StackBar.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { BarContext, BarProps } from './Bar';\nimport { HorizontalBarProps } from './HorizontalBar';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IStackBarProps extends StackBarProps, UnknownProperties {}\nexport type StackBarProps = 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 /** Stack generators\n * @default d3.stack() */\n /** @deprecated */\n stack?: any;\n /**\n * The maximum width of each Bar\n */\n maxBarSize?: number;\n};\n\n/** @deprecated */\nexport interface IStackBarContext extends StackBarContext, UnknownProperties {}\nexport type StackBarContext = {\n /** Series is an array of points, where each point corresponds to the element in the input data. */\n /** @deprecated */\n series: any[];\n};\n\ndeclare const StackBar: IntergalacticD3Component<'g', StackBarProps, StackBarContext> & {\n Bar: IntergalacticD3Component<'path', BarProps, BarContext>;\n HorizontalBar: IntergalacticD3Component<'path', HorizontalBarProps, BarContext>;\n};\n\nexport default StackBar;\n"],"mappings":""}
|
package/lib/es6/Area.js
CHANGED
|
@@ -15,15 +15,15 @@ import createElement from './createElement';
|
|
|
15
15
|
import { definedData, scaleOfBandwidth, getNullData, definedNullData, interpolateValue } from './utils';
|
|
16
16
|
import ClipPath from './ClipPath';
|
|
17
17
|
/*__reshadow-styles__:"./style/area.shadow.css"*/
|
|
18
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
19
|
-
"__SArea": "
|
|
20
|
-
"_color": "
|
|
21
|
-
"--color": "--
|
|
22
|
-
"_transparent": "
|
|
23
|
-
"__SAreaLine": "
|
|
24
|
-
"--duration": "--
|
|
25
|
-
"__SNull": "
|
|
26
|
-
"_hide": "
|
|
18
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SArea_ll2yi_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);fill-opacity:.2}.___SArea_ll2yi_gg_.__color_ll2yi_gg_{fill:var(--color_ll2yi)}.___SArea_ll2yi_gg_.__transparent_ll2yi_gg_{opacity:.3}.___SAreaLine_ll2yi_gg_{stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke-width:3;fill:transparent}.___SAreaLine_ll2yi_gg_.__color_ll2yi_gg_{stroke:var(--color_ll2yi)}.___SAreaLine_ll2yi_gg_.__transparent_ll2yi_gg_{opacity:.3}.___SAreaLine_ll2yi_gg_,.___SArea_ll2yi_gg_{transition-property:d;transition-duration:var(--duration_ll2yi);transition-timing-function:ease-in-out}.___SNull_ll2yi_gg_{fill:transparent;stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf);stroke-dasharray:4}.___SNull_ll2yi_gg_.__hide_ll2yi_gg_{display:none}" /*__inner_css_end__*/, "ll2yi_gg_") /*__reshadow_css_end__*/, {
|
|
19
|
+
"__SArea": "___SArea_ll2yi_gg_",
|
|
20
|
+
"_color": "__color_ll2yi_gg_",
|
|
21
|
+
"--color": "--color_ll2yi",
|
|
22
|
+
"_transparent": "__transparent_ll2yi_gg_",
|
|
23
|
+
"__SAreaLine": "___SAreaLine_ll2yi_gg_",
|
|
24
|
+
"--duration": "--duration_ll2yi",
|
|
25
|
+
"__SNull": "___SNull_ll2yi_gg_",
|
|
26
|
+
"_hide": "__hide_ll2yi_gg_"
|
|
27
27
|
});
|
|
28
28
|
var AreaRoot = /*#__PURE__*/function (_Component) {
|
|
29
29
|
_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_rm3s4_gg_{stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SAxis_rm3s4_gg_.__hide_rm3s4_gg_,.___STick_rm3s4_gg_.__hide_rm3s4_gg_{display:none}.___STick_rm3s4_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-chart-grid-text-label, #6c6e79)}.___SGrid_rm3s4_gg_{fill:transparent;stroke:var(--intergalactic-border-secondary, #e0e1e9)}.___STitle_rm3s4_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-text-hint, #6c6e79);transform-origin:var(--transform-origin_rm3s4)}.___STitle_rm3s4_gg_._position_top_rm3s4_gg_{text-anchor:middle}.___STitle_rm3s4_gg_._position_bottom_rm3s4_gg_{text-anchor:middle;alignment-baseline:hanging}.___STitle_rm3s4_gg_._position_left_rm3s4_gg_,.___STitle_rm3s4_gg_._position_right_rm3s4_gg_{transform:rotate(-90deg);text-anchor:middle;alignment-baseline:middle}.___STitle_rm3s4_gg_._position_left_rm3s4_gg_.__verticalWritingMode_rm3s4_gg_,.___STitle_rm3s4_gg_._position_right_rm3s4_gg_.__verticalWritingMode_rm3s4_gg_{writing-mode:vertical-rl;transform:none}.___STick_rm3s4_gg_._position_top_rm3s4_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_rm3s4_gg_._position_bottom_rm3s4_gg_{transform:translateY(12px);text-anchor:middle;alignment-baseline:hanging}.___STick_rm3s4_gg_._position_right_rm3s4_gg_{transform:translateX(16px);text-anchor:start;alignment-baseline:middle}.___STick_rm3s4_gg_._position_left_rm3s4_gg_{transform:translateX(-16px);text-anchor:end;alignment-baseline:middle}.___STick_rm3s4_gg_._position_custom_0_rm3s4_gg_{transform:translateY(12px);text-anchor:middle;alignment-baseline:hanging}.___STick_rm3s4_gg_._position_custom_1_rm3s4_gg_{transform:translateX(-16px);text-anchor:end;alignment-baseline:middle}" /*__inner_css_end__*/, "rm3s4_gg_") /*__reshadow_css_end__*/, {
|
|
16
|
+
"__SAxis": "___SAxis_rm3s4_gg_",
|
|
17
|
+
"_hide": "__hide_rm3s4_gg_",
|
|
18
|
+
"__STick": "___STick_rm3s4_gg_",
|
|
19
|
+
"__SGrid": "___SGrid_rm3s4_gg_",
|
|
20
|
+
"__STitle": "___STitle_rm3s4_gg_",
|
|
21
|
+
"--transform-origin": "--transform-origin_rm3s4",
|
|
22
|
+
"_position_top": "_position_top_rm3s4_gg_",
|
|
23
|
+
"_position_bottom": "_position_bottom_rm3s4_gg_",
|
|
24
|
+
"_position_right": "_position_right_rm3s4_gg_",
|
|
25
|
+
"_position_left": "_position_left_rm3s4_gg_",
|
|
26
|
+
"_verticalWritingMode": "__verticalWritingMode_rm3s4_gg_",
|
|
27
|
+
"_position_custom_0": "_position_custom_0_rm3s4_gg_",
|
|
28
|
+
"_position_custom_1": "_position_custom_1_rm3s4_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
|
@@ -13,14 +13,14 @@ import createElement from './createElement';
|
|
|
13
13
|
import ClipPath from './ClipPath';
|
|
14
14
|
import { scaleToBand, roundedPath } from './utils';
|
|
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
|
-
"_hide": "
|
|
22
|
-
"_transparent": "
|
|
23
|
-
"__SBackground": "
|
|
16
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBar_14diw_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_14diw);transition-timing-function:ease-in-out}.___SBar_14diw_gg_.__color_14diw_gg_{fill:var(--color_14diw)}.___SBar_14diw_gg_.__hide_14diw_gg_{display:none}.___SBar_14diw_gg_.__transparent_14diw_gg_{opacity:.3}.___SBackground_14diw_gg_{fill:var(--intergalactic-chart-palette-order-other-data, #c4c7cf)}" /*__inner_css_end__*/, "14diw_gg_") /*__reshadow_css_end__*/, {
|
|
17
|
+
"__SBar": "___SBar_14diw_gg_",
|
|
18
|
+
"--duration": "--duration_14diw",
|
|
19
|
+
"_color": "__color_14diw_gg_",
|
|
20
|
+
"--color": "--color_14diw",
|
|
21
|
+
"_hide": "__hide_14diw_gg_",
|
|
22
|
+
"_transparent": "__transparent_14diw_gg_",
|
|
23
|
+
"__SBackground": "___SBackground_14diw_gg_"
|
|
24
24
|
});
|
|
25
25
|
export var MIN_HEIGHT = 2;
|
|
26
26
|
var calcPartBarY = function calcPartBarY(y, minHeight, height) {
|
|
@@ -92,15 +92,18 @@ var BarRoot = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
widthProps = _this$asProps3.width,
|
|
93
93
|
groupKey = _this$asProps3.groupKey,
|
|
94
94
|
onClick = _this$asProps3.onClick,
|
|
95
|
-
transparent = _this$asProps3.transparent
|
|
95
|
+
transparent = _this$asProps3.transparent,
|
|
96
|
+
_this$asProps3$maxBar = _this$asProps3.maxBarSize,
|
|
97
|
+
maxBarSize = _this$asProps3$maxBar === void 0 ? Infinity : _this$asProps3$maxBar;
|
|
96
98
|
var offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
97
99
|
var _scale = _slicedToArray(scale, 2),
|
|
98
100
|
xScale = _scale[0],
|
|
99
101
|
yScale = _scale[1];
|
|
100
102
|
var absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale((_d$y = d[y0]) !== null && _d$y !== void 0 ? _d$y : 0)));
|
|
101
103
|
var height = Number(d[y] - ((_d$y2 = d[y0]) !== null && _d$y2 !== void 0 ? _d$y2 : 0)) === 0 ? 0 : Math.max(absHeight, hMin);
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
+
var bandWidth = widthProps || scaleToBand(xScale).bandwidth();
|
|
105
|
+
var width = Math.min(bandWidth, maxBarSize);
|
|
106
|
+
var barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];
|
|
104
107
|
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);
|
|
105
108
|
var handleClick = function handleClick(event) {
|
|
106
109
|
return onClick === null || onClick === void 0 ? void 0 : onClick(d, event);
|
package/lib/es6/Bar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.js","names":["React","transition","Component","sstyled","uniqueIDEnhancement","createElement","ClipPath","scaleToBand","roundedPath","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","y0","scale","hide","offsetProps","offset","r","hMin","widthProps","width","groupKey","onClick","transparent","_scale","_slicedToArray","xScale","yScale","absHeight","Math","abs","min","domain","Number","max","bandwidth","barX","barY","handleClick","event","dSvg","getRect","radius","Array","isArray","position","dataHintsHandler","describeGroupedValues","describeValueEntity","cn","render","_this$asProps4","size","Fragment","map","bind","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 ClipPath from './ClipPath';\nimport { scaleToBand, roundedPath } from './utils';\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 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 } = 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 width = widthProps || scaleToBand(xScale).bandwidth();\n const barX = xScale(d[x]) + 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 this.asProps.dataHintsHandler.describeGroupedValues(groupKey, y);\n } else {\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${y}`, groupKey ?? d[x]);\n }\n\n return sstyled(styles)(\n <SBar\n aria-hidden\n key={`bar-${i}`}\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={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 }\n render() {\n const { data, uid, size, duration } = this.asProps;\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <ClipPath\n aria-hidden\n key={`${uid}-animation`}\n id={uid}\n x='0'\n y={size[1]}\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,QAAQ,MAAM,YAAY;AACjC,SAASC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAInD,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,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,OAAA;EAAA,SAAAA,QAAA;IAAAK,eAAA,OAAAL,OAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA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EAC3E;EACA,OAAOrF,WAAW,CAAC2B,CAAC,EAAErB,CAAC,EAAEyD,KAAK,EAAEvD,MAAM,EAAE6E,MAAM,CAAC;AACjD;AAEA,eAAexF,aAAa,CAACc,OAAO,EAAE;EAAE0F,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Bar.js","names":["React","transition","Component","sstyled","uniqueIDEnhancement","createElement","ClipPath","scaleToBand","roundedPath","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","y0","scale","hide","offsetProps","offset","r","hMin","widthProps","width","groupKey","onClick","transparent","_this$asProps3$maxBar","maxBarSize","Infinity","_scale","_slicedToArray","xScale","yScale","absHeight","Math","abs","min","domain","Number","max","bandWidth","bandwidth","barX","barY","handleClick","event","dSvg","getRect","radius","Array","isArray","position","dataHintsHandler","describeGroupedValues","describeValueEntity","cn","render","_this$asProps4","size","Fragment","map","bind","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 ClipPath from './ClipPath';\nimport { scaleToBand, roundedPath } from './utils';\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 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 } = 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 this.asProps.dataHintsHandler.describeGroupedValues(groupKey, y);\n } else {\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${y}`, groupKey ?? d[x]);\n }\n\n return sstyled(styles)(\n <SBar\n aria-hidden\n key={`bar-${i}`}\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={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 }\n render() {\n const { data, uid, size, duration } = this.asProps;\n return (\n <>\n {data.map(this.renderBar.bind(this))}\n {duration && (\n <ClipPath\n aria-hidden\n key={`${uid}-animation`}\n id={uid}\n x='0'\n y={size[1]}\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,QAAQ,MAAM,YAAY;AACjC,SAASC,WAAW,EAAEC,WAAW,QA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AACU,SAAS,EAAE;IAAA,UAC9B4B,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC;IAAA,KAC1BtC,MAAM,CAACnD,KAAK,CAAC;IAAA,KACbyF,MAAM,CAAC,CAAC;EAAC,GACZ;AAEN;AAEA,SAAStB,OAAOA,CAAAwB,KAAA,EAA4C;EAAA,IAAzCrF,CAAC,GAAAqF,KAAA,CAADrF,CAAC;IAAErB,CAAC,GAAA0G,KAAA,CAAD1G,CAAC;IAAEyD,KAAK,GAAAiD,KAAA,CAALjD,KAAK;IAAEvD,MAAM,GAAAwG,KAAA,CAANxG,MAAM;IAAEiF,MAAM,GAAAuB,KAAA,CAANvB,MAAM;IAAEG,QAAQ,GAAAoB,KAAA,CAARpB,QAAQ;EACtD,IAAIpF,MAAM,GAAGiF,MAAM,EAAEA,MAAM,GAAGjF,MAAM;EACpC,IAAIiF,MAAM,EAAE;IACV,IAAIG,QAAQ,KAAK,KAAK,EACpB,OAAO5F,WAAW,CAAC2B,CAAC,EAAErB,CAAC,EAAEyD,KAAK,EAAEvD,MAAM,EAAEiF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC;IAC3E,OAAOzF,WAAW,CAAC2B,CAAC,EAAErB,CAAC,EAAEyD,KAAK,EAAEvD,MAAM,EAAEiF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;EAC3E;EACA,OAAOzF,WAAW,CAAC2B,CAAC,EAAErB,CAAC,EAAEyD,KAAK,EAAEvD,MAAM,EAAEiF,MAAM,CAAC;AACjD;AAEA,eAAe5F,aAAa,CAACc,OAAO,EAAE;EAAE8F,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
package/lib/es6/Bubble.js
CHANGED
|
@@ -20,16 +20,16 @@ import ClipPath from './ClipPath';
|
|
|
20
20
|
import { CONSTANT, measureText } from './utils';
|
|
21
21
|
import Tooltip from './Tooltip';
|
|
22
22
|
/*__reshadow-styles__:"./style/bubble.shadow.css"*/
|
|
23
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
24
|
-
"__SBubble": "
|
|
25
|
-
"--duration": "--
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_transparent": "
|
|
29
|
-
"__SCenter": "
|
|
30
|
-
"__SLabel": "
|
|
31
|
-
"_position_right": "
|
|
32
|
-
"_position_left": "
|
|
23
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBubble_12vsc_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_12vsc);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_12vsc_gg_:hover{opacity:.8}}.___SBubble_12vsc_gg_.__color_12vsc_gg_{fill:var(--color_12vsc)}.___SBubble_12vsc_gg_.__transparent_12vsc_gg_{opacity:.3}.___SCenter_12vsc_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SCenter_12vsc_gg_.__color_12vsc_gg_{stroke:var(--color_12vsc)}.___SCenter_12vsc_gg_.__transparent_12vsc_gg_{opacity:.3}.___SLabel_12vsc_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLabel_12vsc_gg_._position_right_12vsc_gg_{text-anchor:end}.___SLabel_12vsc_gg_._position_left_12vsc_gg_{text-anchor:start}.___SLabel_12vsc_gg_.__color_12vsc_gg_{fill:var(--color_12vsc)}.___SLabel_12vsc_gg_.__transparent_12vsc_gg_{opacity:.3}" /*__inner_css_end__*/, "12vsc_gg_") /*__reshadow_css_end__*/, {
|
|
24
|
+
"__SBubble": "___SBubble_12vsc_gg_",
|
|
25
|
+
"--duration": "--duration_12vsc",
|
|
26
|
+
"_color": "__color_12vsc_gg_",
|
|
27
|
+
"--color": "--color_12vsc",
|
|
28
|
+
"_transparent": "__transparent_12vsc_gg_",
|
|
29
|
+
"__SCenter": "___SCenter_12vsc_gg_",
|
|
30
|
+
"__SLabel": "___SLabel_12vsc_gg_",
|
|
31
|
+
"_position_right": "_position_right_12vsc_gg_",
|
|
32
|
+
"_position_left": "_position_left_12vsc_gg_"
|
|
33
33
|
});
|
|
34
34
|
var BubbleRoot = /*#__PURE__*/function (_Component) {
|
|
35
35
|
_inherits(BubbleRoot, _Component);
|
package/lib/es6/Donut.js
CHANGED
|
@@ -22,13 +22,13 @@ import createElement from './createElement';
|
|
|
22
22
|
import { CONSTANT } from './utils';
|
|
23
23
|
import Tooltip from './Tooltip';
|
|
24
24
|
/*__reshadow-styles__:"./style/donut.shadow.css"*/
|
|
25
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
26
|
-
"__SPie": "
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_transparent": "
|
|
30
|
-
"__SEmptyData": "
|
|
31
|
-
"__SLabel": "
|
|
25
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPie_iq5z1_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_iq5z1_gg_.__color_iq5z1_gg_{fill:var(--color_iq5z1)}.___SPie_iq5z1_gg_.__transparent_iq5z1_gg_{opacity:.3}.___SEmptyData_iq5z1_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_iq5z1_gg_.__color_iq5z1_gg_{fill:var(--color_iq5z1)}.___SLabel_iq5z1_gg_{text-anchor:middle;vertical-anchor:middle}" /*__inner_css_end__*/, "iq5z1_gg_") /*__reshadow_css_end__*/, {
|
|
26
|
+
"__SPie": "___SPie_iq5z1_gg_",
|
|
27
|
+
"_color": "__color_iq5z1_gg_",
|
|
28
|
+
"--color": "--color_iq5z1",
|
|
29
|
+
"_transparent": "__transparent_iq5z1_gg_",
|
|
30
|
+
"__SEmptyData": "___SEmptyData_iq5z1_gg_",
|
|
31
|
+
"__SLabel": "___SLabel_iq5z1_gg_"
|
|
32
32
|
});
|
|
33
33
|
var DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
|
|
34
34
|
function transitionAnglePie(_ref6) {
|
package/lib/es6/Dots.js
CHANGED
|
@@ -7,16 +7,16 @@ import trottle from '@semcore/utils/lib/rafTrottle';
|
|
|
7
7
|
import createElement from './createElement';
|
|
8
8
|
import { eventToPoint, invert, interpolateValue } from './utils';
|
|
9
9
|
/*__reshadow-styles__:"./style/dot.shadow.css"*/
|
|
10
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
11
|
-
"__SDots": "
|
|
12
|
-
"__SDot": "
|
|
13
|
-
"--duration": "--
|
|
14
|
-
"--radius": "--
|
|
15
|
-
"_hide": "
|
|
16
|
-
"_active": "
|
|
17
|
-
"_color": "
|
|
18
|
-
"--color": "--
|
|
19
|
-
"_transparent": "
|
|
10
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SDots_160ad_gg_ .___SDot_160ad_gg_{transition-duration:var(--duration_160ad)}.___SDot_160ad_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border, #ffffff);r:var(--radius_160ad);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:cx,cy;transition-timing-function:ease-in-out}.___SDot_160ad_gg_.__hide_160ad_gg_{display:none}.___SDot_160ad_gg_.__active_160ad_gg_{r:calc(var(--radius_160ad)*8/6)}.___SDot_160ad_gg_.__color_160ad_gg_{fill:var(--color_160ad)}.___SDot_160ad_gg_.__transparent_160ad_gg_{opacity:.3}" /*__inner_css_end__*/, "160ad_gg_") /*__reshadow_css_end__*/, {
|
|
11
|
+
"__SDots": "___SDots_160ad_gg_",
|
|
12
|
+
"__SDot": "___SDot_160ad_gg_",
|
|
13
|
+
"--duration": "--duration_160ad",
|
|
14
|
+
"--radius": "--radius_160ad",
|
|
15
|
+
"_hide": "__hide_160ad_gg_",
|
|
16
|
+
"_active": "__active_160ad_gg_",
|
|
17
|
+
"_color": "__color_160ad_gg_",
|
|
18
|
+
"--color": "--color_160ad",
|
|
19
|
+
"_transparent": "__transparent_160ad_gg_"
|
|
20
20
|
});
|
|
21
21
|
var EXCLUDE_PROPS = ['data', 'scale', 'value', 'display'];
|
|
22
22
|
function Dots(props) {
|
package/lib/es6/GroupBar.js
CHANGED
|
@@ -38,16 +38,22 @@ var GroupBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
38
38
|
}
|
|
39
39
|
return acc;
|
|
40
40
|
}, []);
|
|
41
|
-
return scaleBand().range([0, scaleToBand(xyScale).bandwidth()]).domain(domain).paddingInner(
|
|
41
|
+
return scaleBand().range([0, scaleToBand(xyScale).bandwidth()]).domain(domain).paddingInner(0.1).paddingOuter(0.1);
|
|
42
42
|
}
|
|
43
43
|
}, {
|
|
44
44
|
key: "getBarProps",
|
|
45
45
|
value: function getBarProps(_ref) {
|
|
46
46
|
var y = _ref.y;
|
|
47
|
-
var
|
|
47
|
+
var _this$asProps2 = this.asProps,
|
|
48
|
+
x = _this$asProps2.x,
|
|
49
|
+
_this$asProps2$maxBar = _this$asProps2.maxBarSize,
|
|
50
|
+
maxBarSize = _this$asProps2$maxBar === void 0 ? Infinity : _this$asProps2$maxBar;
|
|
51
|
+
var bandWidth = this.scaleGroup.bandwidth();
|
|
52
|
+
var width = Math.min(bandWidth, maxBarSize);
|
|
53
|
+
var offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;
|
|
48
54
|
return {
|
|
49
|
-
offset: [
|
|
50
|
-
width:
|
|
55
|
+
offset: [offsetX, 0],
|
|
56
|
+
width: width,
|
|
51
57
|
x: x,
|
|
52
58
|
groupKey: x
|
|
53
59
|
};
|
|
@@ -56,10 +62,16 @@ var GroupBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
56
62
|
key: "getHorizontalBarProps",
|
|
57
63
|
value: function getHorizontalBarProps(_ref2) {
|
|
58
64
|
var x = _ref2.x;
|
|
59
|
-
var
|
|
65
|
+
var _this$asProps3 = this.asProps,
|
|
66
|
+
y = _this$asProps3.y,
|
|
67
|
+
_this$asProps3$maxBar = _this$asProps3.maxBarSize,
|
|
68
|
+
maxBarSize = _this$asProps3$maxBar === void 0 ? Infinity : _this$asProps3$maxBar;
|
|
69
|
+
var bandWidth = this.scaleGroup.bandwidth();
|
|
70
|
+
var height = Math.min(bandWidth, maxBarSize);
|
|
71
|
+
var offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;
|
|
60
72
|
return {
|
|
61
|
-
offset: [0,
|
|
62
|
-
height:
|
|
73
|
+
offset: [0, offsetY],
|
|
74
|
+
height: height,
|
|
63
75
|
y: y,
|
|
64
76
|
groupKey: y
|
|
65
77
|
};
|
package/lib/es6/GroupBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupBar.js","names":["React","Component","getOriginChildren","createElement","Bar","HorizontalBar","scaleBand","scaleToBand","GroupBarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getScaleGroup","_this$asProps","asProps","Children","scale","scaleGroup","x","xyScale","domain","toArray","reduce","acc","child","isValidElement","type","GroupBar","props","hide","push","y","range","bandwidth","paddingInner","paddingOuter","getBarProps","_ref","
|
|
1
|
+
{"version":3,"file":"GroupBar.js","names":["React","Component","getOriginChildren","createElement","Bar","HorizontalBar","scaleBand","scaleToBand","GroupBarRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","getScaleGroup","_this$asProps","asProps","Children","scale","scaleGroup","x","xyScale","domain","toArray","reduce","acc","child","isValidElement","type","GroupBar","props","hide","push","y","range","bandwidth","paddingInner","paddingOuter","getBarProps","_ref","_this$asProps2","_this$asProps2$maxBar","maxBarSize","Infinity","bandWidth","width","Math","min","offsetX","offset","groupKey","getHorizontalBarProps","_ref2","_this$asProps3","_this$asProps3$maxBar","height","offsetY","render","Element","dataHintsHandler","establishDataType","childrenPosition","_defineProperty"],"sources":["../../src/GroupBar.jsx"],"sourcesContent":["import React from 'react';\nimport { Component } from '@semcore/core';\nimport getOriginChildren from '@semcore/utils/lib/getOriginChildren';\nimport createElement from './createElement';\nimport Bar from './Bar';\nimport HorizontalBar from './HorizontalBar';\nimport { scaleBand } from 'd3-scale';\nimport { scaleToBand } from './utils';\n\nclass GroupBarRoot extends Component {\n static displayName = 'GroupBar';\n\n getScaleGroup() {\n const { Children, scale, scaleGroup, x } = this.asProps;\n // TODO: love that hack (by lsroman) ❤️\n const xyScale = x ? scale[0] : scale[1];\n\n if (scaleGroup) return scaleGroup;\n\n const domain = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {\n if (React.isValidElement(child) && child.type === GroupBar.Bar && !child.props.hide) {\n acc.push(child.props.y);\n }\n if (\n React.isValidElement(child) &&\n child.type === GroupBar.HorizontalBar &&\n !child.props.hide\n ) {\n acc.push(child.props.x);\n }\n return acc;\n }, []);\n\n return scaleBand()\n .range([0, scaleToBand(xyScale).bandwidth()])\n .domain(domain)\n .paddingInner(0.1)\n .paddingOuter(0.1);\n }\n\n getBarProps({ y }) {\n const { x, maxBarSize = Infinity } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const width = Math.min(bandWidth, maxBarSize);\n const offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;\n\n return {\n offset: [offsetX, 0],\n width,\n x,\n groupKey: x,\n };\n }\n\n getHorizontalBarProps({ x }) {\n const { y, maxBarSize = Infinity } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const height = Math.min(bandWidth, maxBarSize);\n const offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;\n\n return {\n offset: [0, offsetY],\n height,\n y,\n groupKey: y,\n };\n }\n\n render() {\n const Element = this.Element;\n this.scaleGroup = this.getScaleGroup();\n\n this.asProps.dataHintsHandler.establishDataType('grouped-values');\n\n return (\n <Element aria-hidden render='g' childrenPosition='inside' scaleGroup={this.scaleGroup} />\n );\n }\n}\n\nconst GroupBar = createElement(GroupBarRoot, {\n Bar,\n HorizontalBar,\n});\n\nexport default GroupBar;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,eAAe;AACzC,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,GAAG,MAAM,OAAO;AACvB,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,SAAS,QAAQ,UAAU;AACpC,SAASC,WAAW,QAAQ,SAAS;AAAC,IAEhCC,YAAY,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,YAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,YAAA;EAAA,SAAAA,aAAA;IAAAK,eAAA,OAAAL,YAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,YAAA;IAAAS,GAAA;IAAAC,KAAA,EAGhB,SAAAC,cAAA,EAAgB;MACd,IAAAC,aAAA,GAA2C,IAAI,CAACC,OAAO;QAA/CC,QAAQ,GAAAF,aAAA,CAARE,QAAQ;QAAEC,KAAK,GAAAH,aAAA,CAALG,KAAK;QAAEC,UAAU,GAAAJ,aAAA,CAAVI,UAAU;QAAEC,CAAC,GAAAL,aAAA,CAADK,CAAC;MACtC;MACA,IAAMC,OAAO,GAAGD,CAAC,GAAGF,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC;MAEvC,IAAIC,UAAU,EAAE,OAAOA,UAAU;MAEjC,IAAMG,MAAM,GAAG3B,KAAK,CAACsB,QAAQ,CAACM,OAAO,CAAC1B,iBAAiB,CAACoB,QAAQ,CAAC,CAAC,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CAAAG,aAAA,CAAC4D,OAAO;QAAC,mBAAW;QAACD,MAAM,EAAC,GAAG;QAACI,gBAAgB,EAAC,QAAQ;QAAC1C,UAAU,EAAE,IAAI,CAACA;MAAW,EAAG;IAE7F;EAAC;EAAA,OAAAhB,YAAA;AAAA,EAtEwBP,SAAS;AAAAkE,eAAA,CAA9B3D,YAAY,iBACK,UAAU;AAwEjC,IAAM0B,QAAQ,GAAG/B,aAAa,CAACK,YAAY,EAAE;EAC3CJ,GAAG,EAAHA,GAAG;EACHC,aAAa,EAAbA;AACF,CAAC,CAAC;AAEF,eAAe6B,QAAQ"}
|
package/lib/es6/HorizontalBar.js
CHANGED
|
@@ -12,14 +12,14 @@ import createElement from './createElement';
|
|
|
12
12
|
import ClipPath from './ClipPath';
|
|
13
13
|
import { scaleToBand, roundedPath } from './utils';
|
|
14
14
|
/*__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
15
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
16
|
-
"__SBar": "
|
|
17
|
-
"--duration": "--
|
|
18
|
-
"_color": "
|
|
19
|
-
"--color": "--
|
|
20
|
-
"_hide": "
|
|
21
|
-
"_transparent": "
|
|
22
|
-
"__SBackground": "
|
|
15
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SBar_14diw_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_14diw);transition-timing-function:ease-in-out}.___SBar_14diw_gg_.__color_14diw_gg_{fill:var(--color_14diw)}.___SBar_14diw_gg_.__hide_14diw_gg_{display:none}.___SBar_14diw_gg_.__transparent_14diw_gg_{opacity:.3}.___SBackground_14diw_gg_{fill:var(--intergalactic-chart-palette-order-other-data, #c4c7cf)}" /*__inner_css_end__*/, "14diw_gg_") /*__reshadow_css_end__*/, {
|
|
16
|
+
"__SBar": "___SBar_14diw_gg_",
|
|
17
|
+
"--duration": "--duration_14diw",
|
|
18
|
+
"_color": "__color_14diw_gg_",
|
|
19
|
+
"--color": "--color_14diw",
|
|
20
|
+
"_hide": "__hide_14diw_gg_",
|
|
21
|
+
"_transparent": "__transparent_14diw_gg_",
|
|
22
|
+
"__SBackground": "___SBackground_14diw_gg_"
|
|
23
23
|
});
|
|
24
24
|
export var MIN_WIDTH = 2;
|
|
25
25
|
var calcPartBarX = function calcPartBarX(x, minWidth, width) {
|
|
@@ -70,15 +70,18 @@ var HorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
70
70
|
onMouseMove = _this$asProps2.onMouseMove,
|
|
71
71
|
onMouseLeave = _this$asProps2.onMouseLeave,
|
|
72
72
|
groupKey = _this$asProps2.groupKey,
|
|
73
|
-
transparent = _this$asProps2.transparent
|
|
73
|
+
transparent = _this$asProps2.transparent,
|
|
74
|
+
_this$asProps2$maxBar = _this$asProps2.maxBarSize,
|
|
75
|
+
maxBarSize = _this$asProps2$maxBar === void 0 ? Infinity : _this$asProps2$maxBar;
|
|
74
76
|
var offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
75
77
|
var _scale = _slicedToArray(scale, 2),
|
|
76
78
|
xScale = _scale[0],
|
|
77
79
|
yScale = _scale[1];
|
|
78
80
|
var absWidth = Math.abs(xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale((_d$x = d[x0]) !== null && _d$x !== void 0 ? _d$x : 0)));
|
|
79
|
-
var
|
|
81
|
+
var bandHeight = heightProps || scaleToBand(yScale).bandwidth();
|
|
82
|
+
var height = Math.min(bandHeight, maxBarSize);
|
|
80
83
|
var width = Number(d[x] - ((_d$x2 = d[x0]) !== null && _d$x2 !== void 0 ? _d$x2 : 0)) === 0 ? 0 : Math.max(absWidth, wMin);
|
|
81
|
-
var barY = yScale(d[y]) + offset[1];
|
|
84
|
+
var barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
82
85
|
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);
|
|
83
86
|
var dSvg = getHorizontalRect({
|
|
84
87
|
x: barX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalBar.js","names":["React","Component","sstyled","uniqueIDEnhancement","createElement","ClipPath","scaleToBand","roundedPath","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","_scale","_slicedToArray","xScale","yScale","absWidth","Math","abs","max","domain","bandwidth","Number","barY","barX","min","dSvg","getHorizontalRect","radius","Array","isArray","position","dataHintsHandler","describeGroupedValues","describeValueEntity","concat","cn","render","_this$asProps3","size","Fragment","map","bind","setAttributeTag","rect","setAttribute","id","transition","_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 ClipPath from './ClipPath';\nimport { scaleToBand, roundedPath } from './utils';\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 } = 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 height = heightProps || scaleToBand(yScale).bandwidth();\n const width = Number(d[x] - (d[x0] ?? 0)) === 0 ? 0 : Math.max(absWidth, wMin);\n const barY = yScale(d[y]) + 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 sstyled(styles)(\n <SBar\n aria-hidden\n key={`horizontal-bar-${i}`}\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={color}\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 }\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 <ClipPath\n aria-hidden\n setAttributeTag={(rect) => {\n rect.setAttribute('width', size[0]);\n }}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n transition={`width ${duration}ms ease-in-out`}\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,QAAQ,MAAM,YAAY;AACjC,SAASC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAInD,OAAO,IAAMC,SAAS,GAAG,CAAC;AAE1B,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,CAAC,EAAEC,QAAQ,EAAEC,KAAK,EAAK;EAC3C;EACA,IAAIF,CAAC,IAAI,CAAC,EAAE;IACV,OAAOE,KAAK,IAAID,QAAQ,GAAGA,QAAQ,GAAG,CAAC;EACzC;EACA;EACA,OAAOE,MAAM,CAACC,EAAE,CAACJ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AM,CAACtC,KAAK;EAAC,GAChB;AAEN;AAEA,SAASkD,iBAAiBA,CAAA6B,KAAA,EAA4C;EAAA,IAAzC9F,CAAC,GAAA8F,KAAA,CAAD9F,CAAC;IAAEsB,CAAC,GAAAwE,KAAA,CAADxE,CAAC;IAAEpB,KAAK,GAAA4F,KAAA,CAAL5F,KAAK;IAAE2C,MAAM,GAAAiD,KAAA,CAANjD,MAAM;IAAEqB,MAAM,GAAA4B,KAAA,CAAN5B,MAAM;IAAEG,QAAQ,GAAAyB,KAAA,CAARzB,QAAQ;EAChE,IAAInE,KAAK,GAAGgE,MAAM,EAAEA,MAAM,GAAGhE,KAAK;EAClC,IAAIgE,MAAM,EAAE;IACV,IAAIG,QAAQ,KAAK,OAAO,EACtB,OAAO3E,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEqB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;IAC3E,OAAOxE,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEqB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;EAC3E;EACA,OAAOxE,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEqB,MAAM,CAAC;AACjD;AAEA,eAAe3E,aAAa,CAACc,iBAAiB,EAAE;EAAEkF,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"HorizontalBar.js","names":["React","Component","sstyled","uniqueIDEnhancement","createElement","ClipPath","scaleToBand","roundedPath","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","_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","cn","render","_this$asProps3","size","Fragment","map","bind","setAttributeTag","rect","setAttribute","id","transition","_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 ClipPath from './ClipPath';\nimport { scaleToBand, roundedPath } from './utils';\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 } = 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 sstyled(styles)(\n <SBar\n aria-hidden\n key={`horizontal-bar-${i}`}\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={color}\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 }\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 <ClipPath\n aria-hidden\n setAttributeTag={(rect) => {\n rect.setAttribute('width', size[0]);\n }}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n transition={`width ${duration}ms ease-in-out`}\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,QAAQ,MAAM,YAAY;AACjC,SAASC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAInD,OAAO,IAAMC,SAAS,GAAG,CAAC;AAE1B,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,CAAC,EAAEC,QAAQ,EAAEC,KAAK,EAAK;EAC3C;EACA,IAAIF,CAAC,IAAI,CAAC,EAAE;IACV,OAAOE,KAAK,IAAID,QAAQ,GAAGA,QAAQ,GAAG,CAAC;EACzC;EACA;EACA,OAAOE,MAAM,CAACC,EAAE,CAACJ,CAAC,EAAE,CAAC,CAAC,GAAGC,QAAQ,GAAG,CAAC;AACvC,CAAC;AAAC,IAEII,iBAAiB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,iBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,iBAAA;EAAA,SAAAA,kBAAA;IAAAK,eAAA,OAAAL,iBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,iBAAA;IAAAS,GAAA;IAAAC,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AAC,GAAAkG,KAAA,CAADlG,CAAC;IAAEsB,CAAC,GAAA4E,KAAA,CAAD5E,CAAC;IAAEpB,KAAK,GAAAgG,KAAA,CAALhG,KAAK;IAAE2C,MAAM,GAAAqD,KAAA,CAANrD,MAAM;IAAEyB,MAAM,GAAA4B,KAAA,CAAN5B,MAAM;IAAEG,QAAQ,GAAAyB,KAAA,CAARzB,QAAQ;EAChE,IAAIvE,KAAK,GAAGoE,MAAM,EAAEA,MAAM,GAAGpE,KAAK;EAClC,IAAIoE,MAAM,EAAE;IACV,IAAIG,QAAQ,KAAK,OAAO,EACtB,OAAO/E,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEyB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC;IAC3E,OAAO5E,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEyB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;EAC3E;EACA,OAAO5E,WAAW,CAACM,CAAC,EAAEsB,CAAC,EAAEpB,KAAK,EAAE2C,MAAM,EAAEyB,MAAM,CAAC;AACjD;AAEA,eAAe/E,aAAa,CAACc,iBAAiB,EAAE;EAAEsF,UAAU,EAAVA;AAAW,CAAC,CAAC"}
|
package/lib/es6/Hover.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, CONSTANT, 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_1lb65_gg_{stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SHoverRect_1lb65_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}" /*__inner_css_end__*/, "1lb65_gg_") /*__reshadow_css_end__*/, {
|
|
20
|
+
"__SHoverLine": "___SHoverLine_1lb65_gg_",
|
|
21
|
+
"__SHoverRect": "___SHoverRect_1lb65_gg_"
|
|
22
22
|
});
|
|
23
23
|
import Tooltip from './Tooltip';
|
|
24
24
|
var Hover = /*#__PURE__*/function (_Component) {
|