@semcore/d3-chart 3.49.0 → 3.50.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 +6 -0
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +16 -10
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +12 -12
- package/lib/cjs/CompactHorizontalBar.js +591 -0
- package/lib/cjs/CompactHorizontalBar.js.map +1 -0
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -10
- 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 +9 -9
- 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/CompactHorizontalBarChart.js +126 -0
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -0
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js +2 -0
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/index.js +3 -1
- package/lib/cjs/component/Chart/index.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/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/bar.shadow.css +36 -0
- package/lib/cjs/types/CompactHorizontalBar.d.js +2 -0
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -0
- package/lib/cjs/types/index.d.js +19 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +16 -10
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +12 -12
- package/lib/es6/CompactHorizontalBar.js +587 -0
- package/lib/es6/CompactHorizontalBar.js.map +1 -0
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -10
- 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 +9 -9
- 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/CompactHorizontalBarChart.js +118 -0
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -0
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js +2 -0
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -0
- package/lib/es6/component/Chart/index.js +3 -1
- package/lib/es6/component/Chart/index.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/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/bar.shadow.css +36 -0
- package/lib/es6/types/CompactHorizontalBar.d.js +2 -0
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -0
- package/lib/es6/types/index.d.js +2 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/types/CompactHorizontalBar.d.ts +88 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +2 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +19 -0
- package/lib/types/component/Chart/index.d.ts +1 -0
- package/lib/types/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBarChart.js","names":["React","createComponent","scaleBand","scaleLinear","CompactHorizontalBar","AbstractChart","CompactHorizontalBarChartComponent","_AbstractChart","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","_this$asProps$xScale","asProps","xScale","valueScale","_this$asProps$yScale","yScale","categoryScale","value","defaultLegendProps","renderChart","_this$asProps","x","y","onClickHoverRect","onClickBar","createElement","renderCompactHorizontalBarTooltip","Hover","onClick","Annotation","Label","Percent","Value","Bar","Background","Fill","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","index","children","Fragment","Title","Dot","renderTooltip","_this$asProps3","_this$asProps3$margin","marginY","plotHeight","range","domain","_toConsumableArray","reverse","map","d","paddingInner","paddingOuter","_this$asProps4","_this$asProps4$margin","plotWidth","sum","_get","_getPrototypeOf","prototype","values","reduce","acc","_defineProperty","direction","showXAxis","showYAxis","showLegend","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/CompactHorizontalBarChart.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent from '@semcore/core';\nimport { BaseChartProps, BaseLegendProps } from './AbstractChart.type';\nimport {\n CompactHorizontalBarChartData,\n CompactHorizontalBarChartProps,\n CompactHorizontalBarChartType,\n} from './CompactHorizontalBarChart.type';\nimport { scaleBand, scaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { CompactHorizontalBar } from '../..';\nimport { AbstractChart } from './AbstractChart';\n\nclass CompactHorizontalBarChartComponent extends AbstractChart<\n CompactHorizontalBarChartData,\n CompactHorizontalBarChartProps\n> {\n static displayName = 'Chart.CompactHorizontalBar';\n public static defaultProps: Partial<BaseChartProps<any>> = {\n direction: 'column',\n showXAxis: false,\n showYAxis: false,\n showTooltip: true,\n showLegend: false,\n };\n\n get xScale() {\n return this.asProps.xScale ?? this.valueScale;\n }\n\n get yScale() {\n return this.asProps.yScale ?? this.categoryScale;\n }\n\n protected defaultLegendProps(): Partial<BaseLegendProps> {\n return {};\n }\n\n renderChart() {\n const { x, y, onClickHoverRect, onClickBar } = this.asProps;\n\n return (\n <CompactHorizontalBar x={x} y={y}>\n {this.renderCompactHorizontalBarTooltip()}\n <CompactHorizontalBar.Hover onClick={onClickHoverRect} />\n <CompactHorizontalBar.Annotation>\n <CompactHorizontalBar.Label />\n <CompactHorizontalBar.Percent />\n <CompactHorizontalBar.Value />\n </CompactHorizontalBar.Annotation>\n <CompactHorizontalBar.Bar onClick={onClickBar}>\n <CompactHorizontalBar.Bar.Background />\n <CompactHorizontalBar.Bar.Fill />\n </CompactHorizontalBar.Bar>\n </CompactHorizontalBar>\n );\n }\n\n protected renderCompactHorizontalBarTooltip(): React.ReactNode {\n const { data, x, y, showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <CompactHorizontalBar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <CompactHorizontalBar.Tooltip.Title>\n {data[index][y]}\n </CompactHorizontalBar.Tooltip.Title>\n\n <CompactHorizontalBar.Tooltip.Dot>\n {data[index][x]}\n </CompactHorizontalBar.Tooltip.Dot>\n </>\n ),\n };\n }}\n </CompactHorizontalBar.Tooltip>\n );\n }\n\n renderTooltip(): React.ReactNode {\n return null;\n }\n\n private get categoryScale() {\n const { marginY = 40, plotHeight, data, y } = this.asProps;\n\n return scaleBand()\n .range([plotHeight - marginY, marginY])\n .domain([...data].reverse().map((d) => d[y]) as any)\n .paddingInner(0.6)\n .paddingOuter(0.2);\n }\n\n private get valueScale() {\n const { marginY = 0, plotWidth } = this.asProps;\n\n const sum = [...super.flatValues.values()].reduce((acc, d) => acc + d, 0);\n\n return scaleLinear().range([marginY, plotWidth]).domain([marginY, sum]);\n }\n}\n\nexport const CompactHorizontalBarChart: CompactHorizontalBarChartType = createComponent(\n CompactHorizontalBarChartComponent,\n);\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBarChart.type.js","names":[],"sources":["../../../../src/component/Chart/CompactHorizontalBarChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\ntype BarKey = string;\n\nexport type CompactHorizontalBarChartData = Array<Record<BarKey, number | string>>;\n\nexport type CompactHorizontalBarChartProps = BaseChartProps<CompactHorizontalBarChartData> & {\n x: string;\n y: string;\n xScale?: ScaleBand<any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n\n /** Handle click by `HoverRect`. `index` is an index of the data array. */\n onClickHoverRect?: (index: number, e: React.SyntheticEvent) => void;\n\n /** Handle click by Bar. */\n onClickBar?: (barItem: number, e: React.SyntheticEvent) => void;\n};\n\nexport type CompactHorizontalBarChartType = Intergalactic.Component<\n typeof Flex,\n CompactHorizontalBarChartProps\n>;\n"],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LineChart } from './LineChart';
|
|
2
2
|
import { BarChart } from './BarChart';
|
|
3
|
+
import { CompactHorizontalBarChart } from './CompactHorizontalBarChart';
|
|
3
4
|
import { HistogramChart } from './HistogramChart';
|
|
4
5
|
import { ScatterPlotChart } from './ScatterPlotChart';
|
|
5
6
|
import { AreaChart } from './AreaChart';
|
|
@@ -18,6 +19,7 @@ export default {
|
|
|
18
19
|
Donut: DonutChart,
|
|
19
20
|
Venn: VennChart,
|
|
20
21
|
Radar: RadarChart,
|
|
21
|
-
Cigarette: CigaretteChart
|
|
22
|
+
Cigarette: CigaretteChart,
|
|
23
|
+
CompactHorizontalBar: CompactHorizontalBarChart
|
|
22
24
|
};
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["LineChart","BarChart","HistogramChart","ScatterPlotChart","AreaChart","BubbleChart","DonutChart","VennChart","RadarChart","CigaretteChart","Line","Bar","Histogram","ScatterPlot","Area","Bubble","Donut","Venn","Radar","Cigarette"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\nimport { CigaretteChart } from './CigaretteChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,eAAe;EACbC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["LineChart","BarChart","CompactHorizontalBarChart","HistogramChart","ScatterPlotChart","AreaChart","BubbleChart","DonutChart","VennChart","RadarChart","CigaretteChart","Line","Bar","Histogram","ScatterPlot","Area","Bubble","Donut","Venn","Radar","Cigarette","CompactHorizontalBar"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\nimport { CigaretteChart } from './CigaretteChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,eAAe;EACbC,IAAI,EAAEX,SAAS;EACfY,GAAG,EAAEX,QAAQ;EACbY,SAAS,EAAEV,cAAc;EACzBW,WAAW,EAAEV,gBAAgB;EAC7BW,IAAI,EAAEV,SAAS;EACfW,MAAM,EAAEV,WAAW;EACnBW,KAAK,EAAEV,UAAU;EACjBW,IAAI,EAAEV,SAAS;EACfW,KAAK,EAAEV,UAAU;EACjBW,SAAS,EAAEV,cAAc;EACzBW,oBAAoB,EAAEnB;AACxB,CAAC"}
|
|
@@ -10,10 +10,10 @@ import React from 'react';
|
|
|
10
10
|
import createComponent, { sstyled, Root } from '@semcore/core';
|
|
11
11
|
import { Flex } from '@semcore/flex-box';
|
|
12
12
|
/*__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
13
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
14
|
-
"__SLegendFlex": "
|
|
15
|
-
"_direction_row": "
|
|
16
|
-
"_direction_column": "
|
|
13
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendFlex_rhv29_gg_._direction_row_rhv29_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_rhv29_gg_._direction_column_rhv29_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}" /*__inner_css_end__*/, "rhv29_gg_") /*__reshadow_css_end__*/, {
|
|
14
|
+
"__SLegendFlex": "___SLegendFlex_rhv29_gg_",
|
|
15
|
+
"_direction_row": "_direction_row_rhv29_gg_",
|
|
16
|
+
"_direction_column": "_direction_column_rhv29_gg_"
|
|
17
17
|
});
|
|
18
18
|
import { LegendItemComponent } from '../LegendItem/LegendItem';
|
|
19
19
|
import Divider from '@semcore/divider';
|
|
@@ -19,23 +19,23 @@ import { Flex, Box } from '@semcore/flex-box';
|
|
|
19
19
|
import Checkbox from '@semcore/checkbox';
|
|
20
20
|
import { Text as TypographyText } from '@semcore/typography';
|
|
21
21
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SLegendItem": "
|
|
24
|
-
"_disabled": "
|
|
25
|
-
"__SPointShape": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_shape_Circle": "
|
|
29
|
-
"_size_l": "
|
|
30
|
-
"_size_m": "
|
|
31
|
-
"_shape_Line": "
|
|
32
|
-
"_shape_Square": "
|
|
33
|
-
"_shape_Pattern": "
|
|
34
|
-
"__SIcon": "
|
|
35
|
-
"__SLabel": "
|
|
36
|
-
"__SAdditionalLabel": "
|
|
37
|
-
"__SCount": "
|
|
38
|
-
"__SPatternSymbol": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendItem_vhnlj_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_vhnlj_gg_:hover{cursor:pointer}.___SLegendItem_vhnlj_gg_.__disabled_vhnlj_gg_:hover{cursor:default}}.___SPointShape_vhnlj_gg_.__color_vhnlj_gg_{background-color:var(--color_vhnlj);margin-right:8px;flex-shrink:0}.___SPointShape_vhnlj_gg_._shape_Circle_vhnlj_gg_._size_l_vhnlj_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_vhnlj_gg_._shape_Circle_vhnlj_gg_._size_m_vhnlj_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_vhnlj_gg_._shape_Line_vhnlj_gg_._size_l_vhnlj_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_vhnlj_gg_._shape_Line_vhnlj_gg_._size_m_vhnlj_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_vhnlj_gg_._shape_Square_vhnlj_gg_._size_l_vhnlj_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_vhnlj_gg_._shape_Square_vhnlj_gg_._size_m_vhnlj_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_vhnlj_gg_._shape_Pattern_vhnlj_gg_{background-color:transparent;margin-right:4px}.___SIcon_vhnlj_gg_{line-height:0;margin-right:4px}.___SIcon_vhnlj_gg_._size_l_vhnlj_gg_{margin-top:4px}.___SIcon_vhnlj_gg_._size_m_vhnlj_gg_{margin-top:2px}.___SLabel_vhnlj_gg_{min-width:0}.___SAdditionalLabel_vhnlj_gg_._size_l_vhnlj_gg_,.___SCount_vhnlj_gg_._size_l_vhnlj_gg_,.___SLabel_vhnlj_gg_._size_l_vhnlj_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_vhnlj_gg_._size_m_vhnlj_gg_,.___SCount_vhnlj_gg_._size_m_vhnlj_gg_,.___SLabel_vhnlj_gg_._size_m_vhnlj_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_vhnlj_gg_,.___SCount_vhnlj_gg_{margin-left:4px}.___SAdditionalLabel_vhnlj_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_vhnlj_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_vhnlj_gg_._size_l_vhnlj_gg_::before{margin-top:10px}.___SAdditionalLabel_vhnlj_gg_._size_m_vhnlj_gg_::before{margin-top:8px}.___SPatternSymbol_vhnlj_gg_{transform:scale(.8)}" /*__inner_css_end__*/, "vhnlj_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SLegendItem": "___SLegendItem_vhnlj_gg_",
|
|
24
|
+
"_disabled": "__disabled_vhnlj_gg_",
|
|
25
|
+
"__SPointShape": "___SPointShape_vhnlj_gg_",
|
|
26
|
+
"_color": "__color_vhnlj_gg_",
|
|
27
|
+
"--color": "--color_vhnlj",
|
|
28
|
+
"_shape_Circle": "_shape_Circle_vhnlj_gg_",
|
|
29
|
+
"_size_l": "_size_l_vhnlj_gg_",
|
|
30
|
+
"_size_m": "_size_m_vhnlj_gg_",
|
|
31
|
+
"_shape_Line": "_shape_Line_vhnlj_gg_",
|
|
32
|
+
"_shape_Square": "_shape_Square_vhnlj_gg_",
|
|
33
|
+
"_shape_Pattern": "_shape_Pattern_vhnlj_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_vhnlj_gg_",
|
|
35
|
+
"__SLabel": "___SLabel_vhnlj_gg_",
|
|
36
|
+
"__SAdditionalLabel": "___SAdditionalLabel_vhnlj_gg_",
|
|
37
|
+
"__SCount": "___SCount_vhnlj_gg_",
|
|
38
|
+
"__SPatternSymbol": "___SPatternSymbol_vhnlj_gg_"
|
|
39
39
|
});
|
|
40
40
|
import { StaticShapes } from './LegendItem.type';
|
|
41
41
|
import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
|
|
@@ -11,12 +11,12 @@ import React from 'react';
|
|
|
11
11
|
import createComponent, { sstyled, Root } from '@semcore/core';
|
|
12
12
|
import { Box } from '@semcore/flex-box';
|
|
13
13
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
14
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
15
|
-
"__SLegendTable": "
|
|
16
|
-
"_columns-count": "__columns-
|
|
17
|
-
"__SColumnItem": "
|
|
18
|
-
"_size_l": "
|
|
19
|
-
"_size_m": "
|
|
14
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendTable_1ni0a_gg_.__columns-count_1ni0a_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_1ni0a_gg_._size_l_1ni0a_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_1ni0a_gg_._size_m_1ni0a_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "1ni0a_gg_") /*__reshadow_css_end__*/, {
|
|
15
|
+
"__SLegendTable": "___SLegendTable_1ni0a_gg_",
|
|
16
|
+
"_columns-count": "__columns-count_1ni0a_gg_",
|
|
17
|
+
"__SColumnItem": "___SColumnItem_1ni0a_gg_",
|
|
18
|
+
"_size_l": "_size_l_1ni0a_gg_",
|
|
19
|
+
"_size_m": "_size_m_1ni0a_gg_"
|
|
20
20
|
});
|
|
21
21
|
import { LegendItemComponent } from '../LegendItem/LegendItem';
|
|
22
22
|
import { BaseLegend } from '../BaseLegend';
|
package/lib/es6/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Chart } from './component/Chart';
|
|
|
4
4
|
export { XAxis, YAxis } from './Axis';
|
|
5
5
|
export { default as Line } from './Line';
|
|
6
6
|
export { default as Bar } from './Bar';
|
|
7
|
+
export { default as CompactHorizontalBar } from './CompactHorizontalBar';
|
|
7
8
|
export { default as HorizontalBar } from './HorizontalBar';
|
|
8
9
|
export { default as GroupBar } from './GroupBar';
|
|
9
10
|
export { default as StackBar } from './StackBar';
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","Chart","XAxis","YAxis","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","ReferenceBackground","ReferenceStripes","HoverLine","HoverRect","minMax","interpolateValue","getBubbleChartValueScale","getScatterPlotRadius","calculateBubbleDomain","PlotEventEmitter","colors","makeDataHintsContainer","PatternFill","PatternSymbol","getPatternSymbolSize"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { ReferenceLine, ReferenceBackground, ReferenceStripes } from './Reference';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport {\n minMax,\n interpolateValue,\n getBubbleChartValueScale,\n getScatterPlotRadius,\n calculateBubbleDomain,\n PlotEventEmitter,\n} from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\nexport { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASH,OAAO,IAAII,KAAK,QAAQ,mBAAmB;AACpD,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AAExC,SAASP,OAAO,IAAIQ,GAAG,QAAQ,OAAO;AACtC,SAASR,OAAO,IAAIS,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","Chart","XAxis","YAxis","Line","Bar","CompactHorizontalBar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","ReferenceBackground","ReferenceStripes","HoverLine","HoverRect","minMax","interpolateValue","getBubbleChartValueScale","getScatterPlotRadius","calculateBubbleDomain","PlotEventEmitter","colors","makeDataHintsContainer","PatternFill","PatternSymbol","getPatternSymbolSize"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as CompactHorizontalBar } from './CompactHorizontalBar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { ReferenceLine, ReferenceBackground, ReferenceStripes } from './Reference';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport {\n minMax,\n interpolateValue,\n getBubbleChartValueScale,\n getScatterPlotRadius,\n calculateBubbleDomain,\n PlotEventEmitter,\n} from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\nexport { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASH,OAAO,IAAII,KAAK,QAAQ,mBAAmB;AACpD,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AAExC,SAASP,OAAO,IAAIQ,GAAG,QAAQ,OAAO;AACtC,SAASR,OAAO,IAAIS,oBAAoB,QAAQ,wBAAwB;AACxE,SAAST,OAAO,IAAIU,aAAa,QAAQ,iBAAiB;AAC1D,SAASV,OAAO,IAAIW,QAAQ,QAAQ,YAAY;AAChD,SAASX,OAAO,IAAIY,QAAQ,QAAQ,YAAY;AAChD,SAASZ,OAAO,IAAIa,IAAI,QAAQ,QAAQ;AACxC,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,WAAW,QAAQ,eAAe;AACtD,SAASf,OAAO,IAAIgB,MAAM,QAAQ,UAAU;AAC5C,SAAShB,OAAO,IAAIiB,UAAU,QAAQ,cAAc;AACpD,SAASjB,OAAO,IAAIkB,KAAK,QAAQ,SAAS;AAC1C,SAASlB,OAAO,IAAImB,IAAI,QAAQ,QAAQ;AACxC,SAASnB,OAAO,IAAIoB,KAAK,EAAEC,sBAAsB,QAAQ,SAAS;AAElE,SAASrB,OAAO,IAAIsB,OAAO,QAAQ,WAAW;AAE9C,SAAStB,OAAO,IAAIuB,mBAAmB,QAAQ,uBAAuB;AACtE,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,aAAa;AAElF,SAASC,SAAS,EAAEC,SAAS,QAAQ,SAAS;AAE9C,SACEC,MAAM,EACNC,gBAAgB,EAChBC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,SAAS;AAChB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,sBAAsB,QAAQ,cAAc;AAErD,SAASC,WAAW,EAAEC,aAAa,EAAEC,oBAAoB,QAAQ,WAAW"}
|
|
@@ -25,6 +25,42 @@ SBar[transparent] {
|
|
|
25
25
|
opacity: 0.3;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
SBar[onClick] {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
SBackground {
|
|
29
33
|
fill: var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9);
|
|
34
|
+
}
|
|
35
|
+
SBackground[onClick] {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
SBarAnnotation {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
}
|
|
43
|
+
SBarLabel {
|
|
44
|
+
color: var(--intergalactic-text-primary, #191b23);
|
|
45
|
+
margin-right: auto;
|
|
46
|
+
font-size: var(--intergalactic-fs-200, 14px);
|
|
47
|
+
line-height: var(--intergalactic-lh-200, 142%);
|
|
48
|
+
}
|
|
49
|
+
SBarPercent {
|
|
50
|
+
color: var(--intergalactic-text-secondary, #6c6e79);
|
|
51
|
+
margin-right: var(--intergalactic-spacing-2x, 8px);
|
|
52
|
+
font-size: var(--intergalactic-fs-200, 14px);
|
|
53
|
+
line-height: var(--intergalactic-lh-200, 142%);
|
|
54
|
+
}
|
|
55
|
+
SBarValue {
|
|
56
|
+
min-width: 52px;
|
|
57
|
+
display: flex;
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
color: var(--intergalactic-text-primary, #191b23);
|
|
60
|
+
font-size: var(--intergalactic-fs-200, 14px);
|
|
61
|
+
line-height: var(--intergalactic-lh-200, 142%);
|
|
62
|
+
text-align: right;
|
|
63
|
+
}
|
|
64
|
+
SCompactHorizontalBarHoverRect {
|
|
65
|
+
fill: var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3));
|
|
30
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBar.d.js","names":[],"sources":["../../../src/types/CompactHorizontalBar.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';\nimport { BoxProps } from '@semcore/flex-box';\nimport { TooltipType } from './Tooltip';\n\nexport type CompactHorizontalBarProps = 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 /**\n * Bars rounded corners\n * @default 2\n */\n radius?: number;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\nexport type CompactHorizontalBarHoverProps = BoxProps;\ntype Hover = IntergalacticD3Component<'rect', CompactHorizontalBarHoverProps, Context>;\nexport type CompactHorizontalBarAnnotationProps = BoxProps;\ntype Annotation = IntergalacticD3Component<\n 'foreignObject',\n CompactHorizontalBarAnnotationProps,\n Context\n>;\nexport type CompactHorizontalBarLabelProps = BoxProps;\ntype Label = IntergalacticD3Component<'div', CompactHorizontalBarLabelProps, Context>;\nexport type CompactHorizontalBarPercentProps = BoxProps;\nexport type CompactHorizontalBarPercentContext = { formatted: string; percent: number };\ntype Percent = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarPercentProps,\n Context & CompactHorizontalBarPercentContext\n>;\nexport type CompactHorizontalBarValueProps = BoxProps;\nexport type CompactHorizontalBarValueContext = { formatted: string; value: number };\ntype Value = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarValueProps,\n Context & CompactHorizontalBarValueContext\n>;\nexport type CompactHorizontalBarBarProps = {};\ntype Bar = IntergalacticD3Component<'g', CompactHorizontalBarBarProps, Context>;\nexport type CompactHorizontalBarBackgroundProps = BoxProps;\ntype Background = IntergalacticD3Component<'rect', BackgroundProps, Context>;\nexport type CompactHorizontalBarFillProps = BoxProps & {\n patterns?: PatternsConfig;\n color?: string;\n transparent?: boolean;\n hide?: boolean;\n};\ntype Fill = IntergalacticD3Component<'rect', CompactHorizontalBarFillProps, Context>;\n\ndeclare const CompactHorizontalBar: IntergalacticD3Component<\n 'g',\n CompactHorizontalBarProps,\n BarContext\n> & {\n Hover: Hover;\n Annotation: Annotation;\n Label: Label;\n Percent: Percent;\n Value: Value;\n Bar: Bar & {\n Background: Background;\n Fill: Fill;\n };\n Tooltip: TooltipType<{\n /** Index in `data` array of the current items */\n index: number;\n }>;\n};\n\nexport default CompactHorizontalBar;\n"],"mappings":""}
|
package/lib/es6/types/index.d.js
CHANGED
|
@@ -22,6 +22,8 @@ export { default as Bar } from './Bar';
|
|
|
22
22
|
export * from './Bar';
|
|
23
23
|
export { default as HorizontalBar } from './HorizontalBar';
|
|
24
24
|
export * from './HorizontalBar';
|
|
25
|
+
export { default as CompactHorizontalBar } from './CompactHorizontalBar';
|
|
26
|
+
export * from './CompactHorizontalBar';
|
|
25
27
|
export { default as GroupBar } from './GroupBar';
|
|
26
28
|
export * from './GroupBar';
|
|
27
29
|
export { default as StackBar } from './StackBar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":["PlotEventEmitter","makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport { interpolateValue as intValue, PlotEventEmitter } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\nexport { PlotEventEmitter };\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport * from './Reference';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n"],"mappings":"AAAA;AACA;AACA,SAAuCA,gBAAgB,QAAQ,SAAS;AASxE,SAASA,gBAAgB;AAEzB,SAASC,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,
|
|
1
|
+
{"version":3,"file":"index.d.js","names":["PlotEventEmitter","makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","CompactHorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport { interpolateValue as intValue, PlotEventEmitter } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\nexport { PlotEventEmitter };\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as CompactHorizontalBar } from './CompactHorizontalBar';\nexport * from './CompactHorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport * from './Reference';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n"],"mappings":"AAAA;AACA;AACA,SAAuCA,gBAAgB,QAAQ,SAAS;AASxE,SAASA,gBAAgB;AAEzB,SAASC,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,oBAAoB,QAAQ,wBAAwB;AACxE,cAAc,wBAAwB;AAEtC,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASP,OAAO,IAAIQ,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASR,OAAO,IAAIS,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAAST,OAAO,IAAIU,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASV,OAAO,IAAIW,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASX,OAAO,IAAIY,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASZ,OAAO,IAAIa,OAAO,QAAQ,WAAW;AAC9C,cAAc,WAAW;AAEzB,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASd,OAAO,IAAIe,MAAM,QAAQ,UAAU;AAC5C,cAAc,UAAU;AAExB,cAAc,aAAa;AAE3B,SAASf,OAAO,IAAIgB,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;;AAEtB;;AAEA;AACA,SAAShB,OAAO,IAAIiB,UAAU,QAAQ,cAAc;;AAEpD;AACA,cAAc,cAAc;;AAE5B;AACA,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;;AAEvE;AACA,cAAc,oDAAoD;AAClE;AACA,cAAc,sDAAsD;AACpE;AACA,cAAc,oDAAoD;;AAElE;AACA,cAAc,WAAW;AAEzB,SAASnB,OAAO,IAAIoB,KAAK,QAAQ,mBAAmB;AACpD,cAAc,sCAAsC;AACpD,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,yCAAyC;AACvD,cAAc,kCAAkC;AAChD,cAAc,oCAAoC;AAClD,cAAc,mCAAmC;AACjD,cAAc,kCAAkC;AAChD,cAAc,mCAAmC;AACjD,cAAc,yCAAyC;AACvD,cAAc,uCAAuC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UnknownProperties } from '@semcore/core';
|
|
3
|
+
import { Context } from './context';
|
|
4
|
+
import { BarContext, BackgroundProps } from './Bar';
|
|
5
|
+
import { IntergalacticD3Component } from './Plot';
|
|
6
|
+
import { PatternsConfig } from './Pattern';
|
|
7
|
+
import { BoxProps } from '@semcore/flex-box';
|
|
8
|
+
import { TooltipType } from './Tooltip';
|
|
9
|
+
|
|
10
|
+
export type CompactHorizontalBarProps = Context & {
|
|
11
|
+
/** Field name from `data` array item for the XAxis */
|
|
12
|
+
x?: string;
|
|
13
|
+
/** Field name from `data` array item for the YAxis */
|
|
14
|
+
y?: string;
|
|
15
|
+
/** Line color */
|
|
16
|
+
color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Bars rounded corners
|
|
19
|
+
* @default 2
|
|
20
|
+
*/
|
|
21
|
+
radius?: number;
|
|
22
|
+
/** Animation duration in ms
|
|
23
|
+
* @default 500
|
|
24
|
+
*/
|
|
25
|
+
duration?: number;
|
|
26
|
+
/** Enables element transparency */
|
|
27
|
+
transparent?: boolean;
|
|
28
|
+
/** Enables charts patterns that enhances charts accessibility */
|
|
29
|
+
patterns?: PatternsConfig;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type CompactHorizontalBarHoverProps = BoxProps;
|
|
33
|
+
type Hover = IntergalacticD3Component<'rect', CompactHorizontalBarHoverProps, Context>;
|
|
34
|
+
export type CompactHorizontalBarAnnotationProps = BoxProps;
|
|
35
|
+
type Annotation = IntergalacticD3Component<
|
|
36
|
+
'foreignObject',
|
|
37
|
+
CompactHorizontalBarAnnotationProps,
|
|
38
|
+
Context
|
|
39
|
+
>;
|
|
40
|
+
export type CompactHorizontalBarLabelProps = BoxProps;
|
|
41
|
+
type Label = IntergalacticD3Component<'div', CompactHorizontalBarLabelProps, Context>;
|
|
42
|
+
export type CompactHorizontalBarPercentProps = BoxProps;
|
|
43
|
+
export type CompactHorizontalBarPercentContext = { formatted: string; percent: number };
|
|
44
|
+
type Percent = IntergalacticD3Component<
|
|
45
|
+
'div',
|
|
46
|
+
CompactHorizontalBarPercentProps,
|
|
47
|
+
Context & CompactHorizontalBarPercentContext
|
|
48
|
+
>;
|
|
49
|
+
export type CompactHorizontalBarValueProps = BoxProps;
|
|
50
|
+
export type CompactHorizontalBarValueContext = { formatted: string; value: number };
|
|
51
|
+
type Value = IntergalacticD3Component<
|
|
52
|
+
'div',
|
|
53
|
+
CompactHorizontalBarValueProps,
|
|
54
|
+
Context & CompactHorizontalBarValueContext
|
|
55
|
+
>;
|
|
56
|
+
export type CompactHorizontalBarBarProps = {};
|
|
57
|
+
type Bar = IntergalacticD3Component<'g', CompactHorizontalBarBarProps, Context>;
|
|
58
|
+
export type CompactHorizontalBarBackgroundProps = BoxProps;
|
|
59
|
+
type Background = IntergalacticD3Component<'rect', BackgroundProps, Context>;
|
|
60
|
+
export type CompactHorizontalBarFillProps = BoxProps & {
|
|
61
|
+
patterns?: PatternsConfig;
|
|
62
|
+
color?: string;
|
|
63
|
+
transparent?: boolean;
|
|
64
|
+
hide?: boolean;
|
|
65
|
+
};
|
|
66
|
+
type Fill = IntergalacticD3Component<'rect', CompactHorizontalBarFillProps, Context>;
|
|
67
|
+
|
|
68
|
+
declare const CompactHorizontalBar: IntergalacticD3Component<
|
|
69
|
+
'g',
|
|
70
|
+
CompactHorizontalBarProps,
|
|
71
|
+
BarContext
|
|
72
|
+
> & {
|
|
73
|
+
Hover: Hover;
|
|
74
|
+
Annotation: Annotation;
|
|
75
|
+
Label: Label;
|
|
76
|
+
Percent: Percent;
|
|
77
|
+
Value: Value;
|
|
78
|
+
Bar: Bar & {
|
|
79
|
+
Background: Background;
|
|
80
|
+
Fill: Fill;
|
|
81
|
+
};
|
|
82
|
+
Tooltip: TooltipType<{
|
|
83
|
+
/** Index in `data` array of the current items */
|
|
84
|
+
index: number;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export default CompactHorizontalBar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Intergalactic } from '@semcore/core';
|
|
3
|
+
import { Flex } from '@semcore/flex-box';
|
|
4
|
+
import { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
|
|
5
|
+
import { BaseChartProps } from './AbstractChart.type';
|
|
6
|
+
type BarKey = string;
|
|
7
|
+
export type CompactHorizontalBarChartData = Array<Record<BarKey, number | string>>;
|
|
8
|
+
export type CompactHorizontalBarChartProps = BaseChartProps<CompactHorizontalBarChartData> & {
|
|
9
|
+
x: string;
|
|
10
|
+
y: string;
|
|
11
|
+
xScale?: ScaleBand<any> | ScaleTime<any, any>;
|
|
12
|
+
yScale?: ScaleLinear<any, any>;
|
|
13
|
+
/** Handle click by `HoverRect`. `index` is an index of the data array. */
|
|
14
|
+
onClickHoverRect?: (index: number, e: React.SyntheticEvent) => void;
|
|
15
|
+
/** Handle click by Bar. */
|
|
16
|
+
onClickBar?: (barItem: number, e: React.SyntheticEvent) => void;
|
|
17
|
+
};
|
|
18
|
+
export type CompactHorizontalBarChartType = Intergalactic.Component<typeof Flex, CompactHorizontalBarChartProps>;
|
|
19
|
+
export {};
|
|
@@ -9,5 +9,6 @@ declare const _default: {
|
|
|
9
9
|
Venn: import("./VennChart.type").VennChartType;
|
|
10
10
|
Radar: import("./RadarChart.type").RadarChartType;
|
|
11
11
|
Cigarette: import("./CigaretteChart.type").CigaretteChartType;
|
|
12
|
+
CompactHorizontalBar: import("./CompactHorizontalBarChart.type").CompactHorizontalBarChartType;
|
|
12
13
|
};
|
|
13
14
|
export default _default;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export * from './Bar';
|
|
|
38
38
|
export { default as HorizontalBar } from './HorizontalBar';
|
|
39
39
|
export * from './HorizontalBar';
|
|
40
40
|
|
|
41
|
+
export { default as CompactHorizontalBar } from './CompactHorizontalBar';
|
|
42
|
+
export * from './CompactHorizontalBar';
|
|
43
|
+
|
|
41
44
|
export { default as GroupBar } from './GroupBar';
|
|
42
45
|
export * from './GroupBar';
|
|
43
46
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/d3-chart",
|
|
3
3
|
"description": "Semrush D3 Chart Component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.50.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@semcore/animation": "2.30.0",
|
|
19
19
|
"@semcore/divider": "4.29.0",
|
|
20
20
|
"@semcore/flex-box": "5.30.0",
|
|
21
|
-
"@semcore/popper": "5.38.
|
|
21
|
+
"@semcore/popper": "5.38.1",
|
|
22
22
|
"@semcore/utils": "4.31.0",
|
|
23
23
|
"@types/d3-shape": "^3.1.0",
|
|
24
24
|
"@upsetjs/venn.js": "1.4.2",
|