@semcore/mini-chart 17.2.2 → 18.0.0-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/cjs/component/score/line.shadow.css +4 -4
- package/lib/cjs/{component → components}/score/Donut.js +10 -10
- package/lib/cjs/components/score/Donut.js.map +1 -0
- package/lib/cjs/{component → components}/score/Line.js +24 -23
- package/lib/cjs/components/score/Line.js.map +1 -0
- package/lib/cjs/components/score/index.js.map +1 -0
- package/lib/cjs/{component → components}/trend/Bar.js +8 -8
- package/lib/cjs/components/trend/Bar.js.map +1 -0
- package/lib/cjs/{component → components}/trend/Line.js +8 -8
- package/lib/cjs/components/trend/Line.js.map +1 -0
- package/lib/cjs/components/trend/Trend.js.map +1 -0
- package/lib/cjs/components/trend/index.js.map +1 -0
- package/lib/cjs/index.js +3 -4
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/{component/score → styles}/donut.shadow.css +1 -1
- package/lib/cjs/styles/line.shadow.css +62 -0
- package/lib/cjs/types.js +2 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/es6/component/score/line.shadow.css +4 -4
- package/lib/es6/{component → components}/score/Donut.js +10 -10
- package/lib/es6/components/score/Donut.js.map +1 -0
- package/lib/es6/{component → components}/score/Line.js +24 -23
- package/lib/es6/components/score/Line.js.map +1 -0
- package/lib/es6/components/score/index.js +3 -0
- package/lib/es6/components/score/index.js.map +1 -0
- package/lib/es6/{component → components}/trend/Bar.js +8 -8
- package/lib/es6/components/trend/Bar.js.map +1 -0
- package/lib/es6/{component → components}/trend/Line.js +8 -8
- package/lib/es6/components/trend/Line.js.map +1 -0
- package/lib/es6/components/trend/Trend.js.map +1 -0
- package/lib/es6/components/trend/index.js +3 -0
- package/lib/es6/components/trend/index.js.map +1 -0
- package/lib/es6/index.js +3 -4
- package/lib/es6/index.js.map +1 -1
- package/lib/{esm/component/score → es6/styles}/donut.shadow.css +1 -1
- package/lib/es6/styles/line.shadow.css +62 -0
- package/lib/es6/types.js +2 -0
- package/lib/es6/types.js.map +1 -0
- package/lib/esm/component/score/line.shadow.css +4 -4
- package/lib/esm/{component → components}/score/Donut.mjs +11 -11
- package/lib/esm/{component → components}/score/Line.mjs +22 -24
- package/lib/esm/{component → components}/trend/Bar.mjs +9 -9
- package/lib/esm/{component → components}/trend/Line.mjs +9 -9
- package/lib/esm/index.mjs +8 -8
- package/lib/{es6/component/score → esm/styles}/donut.shadow.css +1 -1
- package/lib/esm/styles/line.shadow.css +62 -0
- package/lib/types/components/score/Donut.d.ts +14 -0
- package/lib/types/components/score/Donut.d.ts.map +1 -0
- package/lib/types/{component → components}/score/Line.d.ts +2 -2
- package/lib/types/components/score/Line.d.ts.map +1 -0
- package/lib/types/components/score/index.d.ts +3 -0
- package/lib/types/components/score/index.d.ts.map +1 -0
- package/lib/types/components/trend/Bar.d.ts +14 -0
- package/lib/types/components/trend/Bar.d.ts.map +1 -0
- package/lib/types/components/trend/Line.d.ts +14 -0
- package/lib/types/components/trend/Line.d.ts.map +1 -0
- package/lib/types/components/trend/Trend.d.ts +19 -0
- package/lib/types/components/trend/Trend.d.ts.map +1 -0
- package/lib/types/components/trend/index.d.ts +3 -0
- package/lib/types/components/trend/index.d.ts.map +1 -0
- package/lib/types/index.d.ts +11 -13
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/types.d.ts +153 -0
- package/lib/types/types.d.ts.map +1 -0
- package/package.json +5 -5
- package/lib/cjs/component/score/Donut.js.map +0 -1
- package/lib/cjs/component/score/Line.js.map +0 -1
- package/lib/cjs/component/score/Line.types.js +0 -2
- package/lib/cjs/component/score/Line.types.js.map +0 -1
- package/lib/cjs/component/score/Score.js +0 -2
- package/lib/cjs/component/score/Score.js.map +0 -1
- package/lib/cjs/component/score/index.js.map +0 -1
- package/lib/cjs/component/trend/Bar.js.map +0 -1
- package/lib/cjs/component/trend/Line.js.map +0 -1
- package/lib/cjs/component/trend/Trend.js.map +0 -1
- package/lib/cjs/component/trend/index.js.map +0 -1
- package/lib/es6/component/score/Donut.js.map +0 -1
- package/lib/es6/component/score/Line.js.map +0 -1
- package/lib/es6/component/score/Line.types.js +0 -2
- package/lib/es6/component/score/Line.types.js.map +0 -1
- package/lib/es6/component/score/Score.js +0 -2
- package/lib/es6/component/score/Score.js.map +0 -1
- package/lib/es6/component/score/index.js +0 -4
- package/lib/es6/component/score/index.js.map +0 -1
- package/lib/es6/component/trend/Bar.js.map +0 -1
- package/lib/es6/component/trend/Line.js.map +0 -1
- package/lib/es6/component/trend/Trend.js.map +0 -1
- package/lib/es6/component/trend/index.js +0 -4
- package/lib/es6/component/trend/index.js.map +0 -1
- package/lib/types/component/score/Donut.d.ts +0 -36
- package/lib/types/component/score/Donut.d.ts.map +0 -1
- package/lib/types/component/score/Line.d.ts.map +0 -1
- package/lib/types/component/score/Line.types.d.ts +0 -57
- package/lib/types/component/score/Line.types.d.ts.map +0 -1
- package/lib/types/component/score/Score.d.ts +0 -25
- package/lib/types/component/score/Score.d.ts.map +0 -1
- package/lib/types/component/score/index.d.ts +0 -4
- package/lib/types/component/score/index.d.ts.map +0 -1
- package/lib/types/component/trend/Bar.d.ts +0 -49
- package/lib/types/component/trend/Bar.d.ts.map +0 -1
- package/lib/types/component/trend/Line.d.ts +0 -57
- package/lib/types/component/trend/Line.d.ts.map +0 -1
- package/lib/types/component/trend/Trend.d.ts +0 -40
- package/lib/types/component/trend/Trend.d.ts.map +0 -1
- package/lib/types/component/trend/index.d.ts +0 -4
- package/lib/types/component/trend/index.d.ts.map +0 -1
- /package/lib/cjs/{component → components}/score/index.js +0 -0
- /package/lib/cjs/{component → components}/trend/Trend.js +0 -0
- /package/lib/cjs/{component → components}/trend/index.js +0 -0
- /package/lib/cjs/{component/skeleton → styles}/skeleton.shadow.css +0 -0
- /package/lib/es6/{component → components}/trend/Trend.js +0 -0
- /package/lib/es6/{component/skeleton → styles}/skeleton.shadow.css +0 -0
- /package/lib/esm/{component → components}/score/index.mjs +0 -0
- /package/lib/esm/{component → components}/trend/Trend.mjs +0 -0
- /package/lib/esm/{component → components}/trend/index.mjs +0 -0
- /package/lib/esm/{component/skeleton → styles}/skeleton.shadow.css +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["Box","Flex","createComponent","Component","Root","sstyled","resolveColorEnhance","React","style","_sstyled","insert","LineRoot","getSegmentProps","segmentProps","children","resolveColor","asProps","sum","Children","forEach","child","isValidElement","props","value","width","color","render","_ref","_ref5","SLineGauge","SLineValue","SAnimationLine","SLineGaugeSegment","SLineSegmentItem","styles","baseBgColor","loading","animate","undefined","_ref3","createElement","cn","_assignProps","segments","SegmentItems","i","_ref4","push","percent","_assignProps2","Boolean","length","_defineProperty","Segment","_ref2","arguments[0]","_ref6","_assignProps3","displayName","ScoreLine"],"sources":["../../../../src/component/score/Line.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport style from './line.shadow.css';\nimport type {\n ScoreLineComponent,\n ScoreLineGaugeProps,\n SegmentProps,\n InnerSegmentProps,\n ScoreLineGaugeDefaultProps,\n} from './Line.types';\n\nclass LineRoot extends Component<\n ScoreLineGaugeProps,\n typeof LineRoot.enhance,\n {},\n {},\n {},\n ScoreLineGaugeDefaultProps\n> {\n static enhance = [resolveColorEnhance()] as const;\n static displayName = 'ScoreLine';\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n } as const;\n\n getSegmentProps(segmentProps: SegmentProps) {\n const { children, resolveColor } = this.asProps;\n\n let sum = 0;\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<SegmentProps>(child)) {\n sum = sum + child.props.value;\n }\n });\n\n const width = sum > 0 ? (100 * segmentProps.value) / sum : 0;\n\n return {\n 'w': `${width}%`,\n 'use:color': resolveColor(segmentProps.color),\n };\n }\n\n render() {\n const SLineGauge = Root;\n const SLineValue = Box;\n const SAnimationLine = Box;\n const SLineGaugeSegment = Flex;\n const SLineSegmentItem = Box;\n const {\n value,\n styles,\n color = 'chart-palette-order-1',\n baseBgColor,\n resolveColor,\n loading,\n children,\n Children,\n animate,\n } = this.asProps;\n\n if (children !== undefined) {\n return sstyled(styles)(\n <SLineGauge render={Box} segments base-bg-color={resolveColor(baseBgColor)}>\n <SLineGaugeSegment>\n <Children />\n </SLineGaugeSegment>\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n\n const { segments } = this.asProps;\n\n const SegmentItems = [];\n\n if (segments) {\n for (let i = 0; i < segments; i++) {\n const width = `calc((100% - ${segments - 1}px) / ${segments})`;\n\n SegmentItems.push(\n sstyled(styles)(\n <SLineSegmentItem\n key={i}\n color={i < value ? resolveColor(color) : undefined}\n w={width}\n />,\n ),\n );\n }\n }\n\n let percent = `${value}%`;\n\n if (segments) {\n percent = `${(value / segments) * 100}%`;\n }\n\n return sstyled(styles)(\n <SLineGauge render={Box} base-bg-color={resolveColor(baseBgColor)}>\n {!loading && <SLineValue w={percent} color={resolveColor(color)} />}\n {Boolean(SegmentItems.length) && <SLineGaugeSegment>{SegmentItems}</SLineGaugeSegment>}\n {animate && <SAnimationLine />}\n </SLineGauge>,\n );\n }\n}\n\nfunction Segment(props: InnerSegmentProps) {\n const { styles, value } = props;\n const SLineSegmentItem = Root;\n\n if (!value) return null;\n\n return sstyled(styles)(<SLineSegmentItem render={Box} />);\n}\nSegment.displayName = 'Segment';\n\n/**\n * MiniCharts.ScoreLine\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}\n */\nexport const ScoreLine = createComponent<\n ScoreLineComponent,\n typeof LineRoot\n>(LineRoot, { Segment });\n\nScoreLine.displayName = 'MiniChart.ScoreLine';\n"],"mappings":";;;;;AAAA,SAASA,GAAG,EAAEC,IAA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,IAAI,CAACuB,KAAK,EAAE,OAAO,IAAI;EAEvB,OAAAiC,KAAA,GAAOnD,OAAO,CAAC6B,MAAM,CAAC,eAAC3B,KAAA,CAAAiC,aAAA,CAACP,gBAAgB,EAAAuB,KAAA,CAAAf,EAAA;IAAA,GAAAgB,aAAA,KAAAH,KAAA;EAAA,EAAe,CAAC;AAC1D;AACAD,OAAO,CAACK,WAAW,GAAG,SAAS;;AAE/B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAGzD,eAAe,CAGtCS,QAAQ,EAAE;EAAE0C;AAAQ,CAAC,CAAC;AAExBM,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.types.js","names":[],"sources":["../../../../src/component/score/Line.types.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport type React from 'react';\n\nimport type { CommonScoreProps } from './Score';\n\ntype Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N\n ? Acc[number]\n : Enumerate<N, [...Acc, Acc['length']]>;\n\ntype Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;\n\nexport type SegmentColor = `chart-palette-order-${Range<1, 24>}`;\n\nexport type SegmentProps = {\n value: number;\n /**\n * Color of value\n */\n color: SegmentColor;\n};\n\ntype SegmentComponent = React.FC<SegmentProps>;\n\nexport type InnerSegmentProps = SegmentProps & {\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;\n};\n\ntype ValuedScoreProps = {\n /**\n * Value of score (in percents from 0 to 100) or count of selected segments (for Line with segments)\n */\n value: number;\n /**\n * Color of value\n */\n color?: SegmentColor;\n /**\n * Count of line segments\n */\n segments?: number;\n /**\n * We don't accept children in this way\n */\n children?: never;\n};\n\ntype CustomRenderScoreProps = {\n value?: never;\n segments?: never;\n color?: never;\n children: SegmentComponent[];\n};\n\nexport type ScoreLineGaugeProps = NSBox.Props &\n Intergalactic.InternalTypings.EfficientOmit<CommonScoreProps, 'value' | 'color'> &\n (ValuedScoreProps | CustomRenderScoreProps);\n\nexport type ScoreLineGaugeDefaultProps = {\n animate: true;\n};\n\nexport type Enhances = [() => {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n}];\n\nexport type ScoreLineComponent = Intergalactic.Component<'svg', ScoreLineGaugeProps, {}, Enhances> & {\n Segment: Intergalactic.Component<NSBox.Component, SegmentProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Score.js","names":[],"sources":["../../../../src/component/score/Score.ts"],"sourcesContent":["export type CommonScoreProps = {\n /**\n * Value of score (in percents from 0 to 100) or count of selected segments (for Line with segments)\n */\n value: number;\n\n /**\n * Color of value\n */\n color?: string;\n\n /**\n * Color of background\n */\n baseBgColor?: string;\n\n /**\n * Flag to enable skeleton\n * @default false\n */\n loading?: boolean;\n\n /**\n * Flag to enable animate of charts\n * @default true\n */\n animate?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ScoreDonut","ScoreSemiDonut","ScoreLine"],"sources":["../../../../src/component/score/index.ts"],"sourcesContent":["import { ScoreDonut, ScoreSemiDonut } from './Donut';\nimport { ScoreLine } from './Line';\n\nexport { ScoreDonut, ScoreSemiDonut, ScoreLine };\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,cAAc,QAAQ,SAAS;AACpD,SAASC,SAAS,QAAQ,QAAQ;AAElC,SAASF,UAAU,EAAEC,cAAc,EAAEC,SAAS","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.js","names":["Box","createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","React","Trend","style","_sstyled","insert","TrendBarRoot","defaultData","value","data","loading","asProps","render","_ref","_ref2","STrendBar","styles","resolveColor","isHistogram","animate","step","defaultWidth","length","__excludeProps","extractedAriaProps","createElement","cn","_assignProps","containerRef","svgWidth","svgHeight","map","barItem","index","color","key","x","y","defaultHeight","width","height","fill","attributeName","values","dur","_defineProperty","TrendBar","displayName","TrendHistogram","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Bar.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, assignProps, Root, sstyled } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport React from 'react';\n\nimport { Trend, type CommonTrendProps } from './Trend';\nimport style from '../skeleton/skeleton.shadow.css';\n\ntype BarItem = {\n /**\n * Value\n */\n value: number;\n /**\n * Color of value\n */\n color?: string;\n};\n\nexport type TrendBarProps = CommonTrendProps & {\n /**\n * Data to bar chart\n */\n data: BarItem[];\n};\n\ntype TrendBarComponent = Intergalactic.Component<'svg', TrendBarProps, {}, typeof TrendBarRoot.enhance>;\n\ntype TrendBarDefaultProps = {\n animate: true;\n};\n\nclass TrendBarRoot extends Trend<TrendBarProps, typeof TrendBarRoot.enhance, TrendBarDefaultProps> {\n static enhance = [resolveColorEnhance()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n } as const;\n\n get defaultData(): BarItem[] {\n return [{ value: 20 }, { value: 80 }, { value: 45 }, { value: 10 }];\n }\n\n get data(): BarItem[] {\n const { data, loading } = this.asProps;\n\n if (loading) {\n return this.defaultData;\n }\n\n return data;\n }\n\n render() {\n const STrendBar = Root;\n const { styles, resolveColor, isHistogram, animate, loading } = this.asProps;\n const step = this.defaultWidth / this.data.length;\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <STrendBar render={Box} ref={this.containerRef} __excludeProps={['data', ...__excludeProps]}>\n <svg\n width='100%'\n height='100%'\n viewBox={`0 0 ${this.svgWidth} ${this.svgHeight}`}\n role='img'\n {...extractedAriaProps}\n >\n {this.data.map((barItem, index) => {\n let color = resolveColor('chart-palette-order-other-data');\n\n if (barItem.color) {\n color = resolveColor(barItem.color);\n }\n\n return (\n <rect\n key={index}\n x={step * index}\n y={this.defaultHeight - barItem.value}\n width={isHistogram ? step : step * 0.8}\n height={barItem.value}\n fill={color}\n >\n {animate && !loading && (\n <animate\n attributeName='y'\n values={`${this.defaultHeight};${this.defaultHeight - barItem.value}`}\n dur='500ms'\n />\n )}\n </rect>\n );\n })}\n </svg>\n </STrendBar>,\n );\n }\n}\n\n/**\n * MiniCharts.TrendBar\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}\n */\nexport const TrendBar = createComponent<\n TrendBarComponent,\n typeof TrendBarRoot\n>(TrendBarRoot);\n\nTrendBar.displayName = 'MiniChart.TrendBar';\n\n/**\n * MiniCharts.TrendHistogram\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}\n */\nexport const TrendHistogram = createComponent<\n TrendBarComponent,\n typeof TrendBarRoot\n>(\n TrendBarRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: TrendBarProps) => {\n return assignProps(props, { isHistogram: true });\n },\n };\n },\n ],\n },\n);\n\nTrendHistogram.displayName = 'MiniChart.TrendHistogram';\n"],"mappings":";;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,SAASC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC3E,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAO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e,CAGrCW,YAAY,CAAC;AAEfwC,QAAQ,CAACC,WAAW,GAAG,oBAAoB;;AAE3C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGrD,eAAe,CAI3CW,YAAY,EACZ,CAAC,CAAC,EACF;EACE2C,YAAY,EAAE,CACZ,MAAM;IACJ,OAAO;MACLC,YAAY,EAAGC,KAAoB,IAAK;QACtC,OAAOvD,WAAW,CAACuD,KAAK,EAAE;UAAEjC,WAAW,EAAE;QAAK,CAAC,CAAC;MAClD;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAED8B,cAAc,CAACD,WAAW,GAAG,0BAA0B","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.js","names":["Box","createComponent","assignProps","Root","sstyled","extractAriaProps","resolveColorEnhance","uniqueIDEnhancement","React","Trend","style","_sstyled","insert","TrendLineRoot","defaultData","lastPointRadius","asProps","data","loading","svgWidth","lastPointColor","defaultWidth","svgHeight","defaultHeight","color","resolveColor","render","_ref","_ref2","STrendLine","uid","withArea","animate","styles","points","length","step","i","push","__excludeProps","extractedAriaProps","createElement","cn","_assignProps","containerRef","join","_defineProperty","TrendLine","displayName","TrendArea","enhancements","wrapperProps","props"],"sources":["../../../../src/component/trend/Line.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, assignProps, Root, sstyled } from '@semcore/core';\nimport { extractAriaProps } from '@semcore/core/lib/utils/ariaProps';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport { Trend, type CommonTrendProps } from './Trend';\nimport style from '../skeleton/skeleton.shadow.css';\n\nexport type TrendLineProps = CommonTrendProps & {\n /**\n * List of values\n */\n data: number[];\n\n /**\n * Color of line\n */\n color?: string;\n\n /**\n * Color of last point in chart\n */\n lastPointColor?: string;\n\n /**\n * Radius for last point item\n */\n lastPointRadius?: number;\n};\n\ntype TrendLineComponent = Intergalactic.Component<'svg', TrendLineProps, {}, typeof TrendLineRoot.enhance>;\n\ntype TrendLineDefaultProps = {\n animate: true;\n};\n\nclass TrendLineRoot extends Trend<TrendLineProps, typeof TrendLineRoot.enhance, TrendLineDefaultProps> {\n static enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\n\n static style = style;\n\n static defaultProps = {\n animate: true,\n } as const;\n\n get defaultData(): number[] {\n return [15, 70, 20, 85, 20];\n }\n\n get lastPointRadius(): number {\n return this.asProps.lastPointRadius ?? 6;\n }\n\n get data(): number[] {\n const { data, loading } = this.asProps;\n\n if (loading) {\n return this.defaultData;\n }\n\n return data;\n }\n\n override get svgWidth(): number {\n return this.asProps.lastPointColor\n ? this.defaultWidth + this.lastPointRadius\n : this.defaultWidth;\n }\n\n override get svgHeight(): number {\n return this.asProps.lastPointColor\n ? this.defaultHeight + this.lastPointRadius\n : this.defaultHeight;\n }\n\n get color() {\n const { resolveColor, color = 'chart-palette-order-1', loading } = this.asProps;\n\n if (loading) {\n return resolveColor('skeleton-bg');\n }\n\n return resolveColor(color);\n }\n\n render() {\n const STrendLine = Root;\n const { uid, withArea, animate, lastPointColor, resolveColor, loading, styles } = this.asProps;\n\n const points: string[] = [];\n const length = this.data.length;\n const step = this.defaultWidth / (length - 1);\n\n for (let i = 0; i < length; i++) {\n points.push(`${step * i},${this.defaultHeight - this.data[i]}`);\n }\n const { __excludeProps, extractedAriaProps } = extractAriaProps(this.asProps);\n\n return sstyled(styles)(\n <STrendLine render={Box} ref={this.containerRef} __excludeProps={['data', ...__excludeProps]}>\n <svg\n width='100%'\n height='100%'\n viewBox={`0 0 ${this.svgWidth} ${this.svgHeight}`}\n role='img'\n {...extractedAriaProps}\n >\n <polyline\n points={points.join(' ')}\n stroke={this.color}\n strokeWidth='4'\n fill='none'\n clipPath={`url(#${uid})`}\n />\n {withArea && (\n <polyline\n points={`0,${this.defaultHeight} ${points.join(' ')} ${this.defaultWidth},${\n this.defaultHeight\n }`}\n fill={this.color}\n fillOpacity={0.2}\n clipPath={`url(#${uid})`}\n />\n )}\n {lastPointColor && !loading && (\n <circle\n cx={step * (length - 1)}\n cy={this.defaultHeight - this.data[length - 1]}\n r={this.lastPointRadius}\n fill={resolveColor(lastPointColor)}\n stroke={resolveColor('chart-grid-border')}\n strokeWidth={4}\n clipPath={`url(#${uid})`}\n />\n )}\n\n {animate && !loading && (\n <clipPath id={uid}>\n <rect x='0' y='0' width='100%' height='100%' fill='black'>\n <animate dur='500ms' attributeName='width' values='0;100%' />\n </rect>\n </clipPath>\n )}\n </svg>\n </STrendLine>,\n );\n }\n}\n\n/**\n * MiniCharts.TrendLine\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}\n */\nexport const TrendLine = createComponent<TrendLineComponent, typeof TrendLineRoot>(TrendLineRoot);\n\nTrendLine.displayName = 'MiniChart.TrendLine';\n\n/**\n * MiniCharts.TrendArea\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}\n */\nexport const TrendArea = createComponent<TrendLineComponent, typeof TrendLineRoot>(\n TrendLineRoot,\n {},\n {\n enhancements: [\n () => {\n return {\n wrapperProps: (props: TrendLineProps) => {\n return assignProps(props, { withArea: true });\n },\n };\n },\n ],\n },\n);\n\nTrendArea.displayName = 'MiniChart.TrendArea';\n"],"mappings":";;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,SAASC,eAAe,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAC3E,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC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I,eAAA,CAjHMjC,aAAa,aACA,CAACP,mBAAmB,CAAC,CAAC,EAAEC,mBAAmB,CAAC,CAAC,CAAC;AAAAuC,eAAA,CAD3DjC,aAAa,WAGFH,KAAK;AAAAoC,eAAA,CAHhBjC,aAAa,kBAKK;EACpBmB,OAAO,EAAE;AACX,CAAC;AA+GH,OAAO,MAAMe,SAAS,GAAG9C,eAAe,CAA2CY,aAAa,CAAC;AAEjGkC,SAAS,CAACC,WAAW,GAAG,qBAAqB;;AAE7C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAGhD,eAAe,CACtCY,aAAa,EACb,CAAC,CAAC,EACF;EACEqC,YAAY,EAAE,CACZ,MAAM;IACJ,OAAO;MACLC,YAAY,EAAGC,KAAqB,IAAK;QACvC,OAAOlD,WAAW,CAACkD,KAAK,EAAE;UAAErB,QAAQ,EAAE;QAAK,CAAC,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AAEL,CACF,CAAC;AAEDkB,SAAS,CAACD,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Trend.js","names":["Component","React","Trend","constructor","args","_defineProperty","width","height","createRef","componentDidMount","setSizes","componentDidUpdate","prevProps","w","props","h","data","defaultWidth","state","defaultHeight","svgWidth","svgHeight","containerRef","current","boundingClientRect","getBoundingClientRect","setState"],"sources":["../../../../src/component/trend/Trend.tsx"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport { Component } from '@semcore/core';\nimport React from 'react';\n\nexport type CommonTrendProps = NSBox.Props & {\n /**\n * Flag to enable animate of charts\n * @default true\n */\n animate?: boolean;\n\n /**\n * Flag to enable skeleton\n * @default false\n */\n loading?: boolean;\n\n /**\n * Data for chart\n */\n data: any[];\n};\n\ntype CommonTrendState = { width: number; height: number };\n\nexport abstract class Trend<\n P extends CommonTrendProps,\n E extends readonly ((...args: any[]) => any)[],\n DP extends Intergalactic.InternalTypings.ValidDefaultProps<DP, P> = never,\n> extends Component<P, E, Readonly<{}>, {}, CommonTrendState, DP> {\n state = {\n width: 200,\n height: 100,\n };\n\n containerRef = React.createRef<HTMLDivElement>();\n\n componentDidMount() {\n this.setSizes();\n }\n\n componentDidUpdate(prevProps: P) {\n if (\n prevProps.w !== this.props.w ||\n prevProps.h !== this.props.h ||\n prevProps.data !== this.props.data\n ) {\n this.setSizes();\n }\n }\n\n get defaultWidth(): number {\n const { width, height } = this.state;\n\n return (width / height) * this.defaultHeight;\n }\n\n get defaultHeight(): number {\n return 100;\n }\n\n get svgWidth(): number {\n return this.defaultWidth;\n }\n\n get svgHeight(): number {\n return this.defaultHeight;\n }\n\n setSizes() {\n if (this.containerRef.current) {\n const boundingClientRect = this.containerRef.current.getBoundingClientRect();\n\n const { width, height } = boundingClientRect;\n\n if (width > 0 && height > 0) {\n this.setState({ width, height });\n }\n }\n }\n}\n"],"mappings":";AAEA,SAASA,SAAS,QAAQ,eAAe;AACzC,OAAOC,KAAK,MAAM,OAAO;AAuBzB,OAAO,MAAeC,KAAK,SAIjBF,SAAS,CAA+C;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBACxD;MACNC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE;IACV,CAAC;IAAAF,eAAA,oCAEcJ,KAAK,CAACO,SAAS,CAAiB,CAAC;EAAA;EAEhDC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,CAACC,QAAQ,CAAC,CAAC;EACjB;EAEAC,kBAAkBA,CAACC,SAAY,EAAE;IAC/B,IACEA,SAAS,CAACC,CAAC,KAAK,IAAI,CAACC,KAAK,CAACD,CAAC,IAC5BD,SAAS,CAACG,CAAC,KAAK,IAAI,CAACD,KAAK,CAACC,CAAC,IAC5BH,SAAS,CAACI,IAAI,KAAK,IAAI,CAACF,KAAK,CAACE,IAAI,EAClC;MACA,IAAI,CAACN,QAAQ,CAAC,CAAC;IACjB;EACF;EAEA,IAAIO,YAAYA,CAAA,EAAW;IACzB,MAAM;MAAEX,KAAK;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACW,KAAK;IAEpC,OAAQZ,KAAK,GAAGC,MAAM,GAAI,IAAI,CAACY,aAAa;EAC9C;EAEA,IAAIA,aAAaA,CAAA,EAAW;IAC1B,OAAO,GAAG;EACZ;EAEA,IAAIC,QAAQA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACH,YAAY;EAC1B;EAEA,IAAII,SAASA,CAAA,EAAW;IACtB,OAAO,IAAI,CAACF,aAAa;EAC3B;EAEAT,QAAQA,CAAA,EAAG;IACT,IAAI,IAAI,CAACY,YAAY,CAACC,OAAO,EAAE;MAC7B,MAAMC,kBAAkB,GAAG,IAAI,CAACF,YAAY,CAACC,OAAO,CAACE,qBAAqB,CAAC,CAAC;MAE5E,MAAM;QAAEnB,KAAK;QAAEC;MAAO,CAAC,GAAGiB,kBAAkB;MAE5C,IAAIlB,KAAK,GAAG,CAAC,IAAIC,MAAM,GAAG,CAAC,EAAE;QAC3B,IAAI,CAACmB,QAAQ,CAAC;UAAEpB,KAAK;UAAEC;QAAO,CAAC,CAAC;MAClC;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TrendBar","TrendHistogram","TrendLine","TrendArea"],"sources":["../../../../src/component/trend/index.ts"],"sourcesContent":["import { TrendBar, TrendHistogram } from './Bar';\nimport { TrendLine, TrendArea } from './Line';\n\nexport { TrendLine, TrendArea, TrendBar, TrendHistogram };\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,cAAc,QAAQ,OAAO;AAChD,SAASC,SAAS,EAAEC,SAAS,QAAQ,QAAQ;AAE7C,SAASD,SAAS,EAAEC,SAAS,EAAEH,QAAQ,EAAEC,cAAc","ignoreList":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { NSBox } from '@semcore/base-components';
|
|
2
|
-
import type { Intergalactic } from '@semcore/core';
|
|
3
|
-
import { Component } from '@semcore/core';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { CommonScoreProps } from './Score';
|
|
6
|
-
export type ScoreDonutProps = NSBox.Props & CommonScoreProps;
|
|
7
|
-
type ScoreDonutDefaultProps = {
|
|
8
|
-
animate: true;
|
|
9
|
-
};
|
|
10
|
-
type ScoreDonutComponent = Intergalactic.Component<'svg', ScoreDonutProps, {}, typeof DonutRoot.enhance>;
|
|
11
|
-
declare class DonutRoot extends Component<ScoreDonutProps, typeof DonutRoot.enhance, {}, {}, {}, ScoreDonutDefaultProps> {
|
|
12
|
-
static enhance: readonly [<T extends {}>(props: T) => T & {
|
|
13
|
-
duration: string;
|
|
14
|
-
}, (props: any) => any];
|
|
15
|
-
static style: {
|
|
16
|
-
[key: string]: string;
|
|
17
|
-
};
|
|
18
|
-
static defaultProps: {
|
|
19
|
-
readonly animate: true;
|
|
20
|
-
};
|
|
21
|
-
render(): React.ReactNode;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* MiniCharts.ScoreDount
|
|
25
|
-
*
|
|
26
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
27
|
-
*/
|
|
28
|
-
export declare const ScoreDonut: ScoreDonutComponent;
|
|
29
|
-
/**
|
|
30
|
-
* MiniCharts.ScoreSemiDount
|
|
31
|
-
*
|
|
32
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
33
|
-
*/
|
|
34
|
-
export declare const ScoreSemiDonut: ScoreDonutComponent;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=Donut.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Donut.d.ts","sourceRoot":"","sources":["../../../../src/component/score/Donut.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAmB,SAAS,EAA8B,MAAM,eAAe,CAAC;AAIvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,KAAK,GAAG,gBAAgB,CAAC;AAE7D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,KAAK,mBAAmB,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AACzG,cAAM,SAAU,SAAQ,SAAS,CAC/B,eAAe,EACf,OAAO,SAAS,CAAC,OAAO,EACxB,EAAE,EACF,EAAE,EACF,EAAE,EACF,sBAAsB,CACvB;IACC,MAAM,CAAC,OAAO;;4BAQH;IAEX,MAAM,CAAC,KAAK;;MAAS;IAErB,MAAM,CAAC,YAAY;;MAER;IAEX,MAAM;CAoFP;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,qBAGX,CAAC;AAIb;;;;GAIG;AACH,eAAO,MAAM,cAAc,qBAiB1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/component/score/Line.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,kBAAkB,EAKnB,MAAM,cAAc,CAAC;AAgHtB;;;;GAIG;AACH,eAAO,MAAM,SAAS,oBAGE,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { NSBox } from '@semcore/base-components';
|
|
2
|
-
import type { Intergalactic } from '@semcore/core';
|
|
3
|
-
import type resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
4
|
-
import type React from 'react';
|
|
5
|
-
import type { CommonScoreProps } from './Score';
|
|
6
|
-
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
7
|
-
type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
8
|
-
export type SegmentColor = `chart-palette-order-${Range<1, 24>}`;
|
|
9
|
-
export type SegmentProps = {
|
|
10
|
-
value: number;
|
|
11
|
-
/**
|
|
12
|
-
* Color of value
|
|
13
|
-
*/
|
|
14
|
-
color: SegmentColor;
|
|
15
|
-
};
|
|
16
|
-
type SegmentComponent = React.FC<SegmentProps>;
|
|
17
|
-
export type InnerSegmentProps = SegmentProps & {
|
|
18
|
-
styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>;
|
|
19
|
-
};
|
|
20
|
-
type ValuedScoreProps = {
|
|
21
|
-
/**
|
|
22
|
-
* Value of score (in percents from 0 to 100) or count of selected segments (for Line with segments)
|
|
23
|
-
*/
|
|
24
|
-
value: number;
|
|
25
|
-
/**
|
|
26
|
-
* Color of value
|
|
27
|
-
*/
|
|
28
|
-
color?: SegmentColor;
|
|
29
|
-
/**
|
|
30
|
-
* Count of line segments
|
|
31
|
-
*/
|
|
32
|
-
segments?: number;
|
|
33
|
-
/**
|
|
34
|
-
* We don't accept children in this way
|
|
35
|
-
*/
|
|
36
|
-
children?: never;
|
|
37
|
-
};
|
|
38
|
-
type CustomRenderScoreProps = {
|
|
39
|
-
value?: never;
|
|
40
|
-
segments?: never;
|
|
41
|
-
color?: never;
|
|
42
|
-
children: SegmentComponent[];
|
|
43
|
-
};
|
|
44
|
-
export type ScoreLineGaugeProps = NSBox.Props & Intergalactic.InternalTypings.EfficientOmit<CommonScoreProps, 'value' | 'color'> & (ValuedScoreProps | CustomRenderScoreProps);
|
|
45
|
-
export type ScoreLineGaugeDefaultProps = {
|
|
46
|
-
animate: true;
|
|
47
|
-
};
|
|
48
|
-
export type Enhances = [
|
|
49
|
-
() => {
|
|
50
|
-
resolveColor: ReturnType<typeof resolveColorEnhance>;
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
export type ScoreLineComponent = Intergalactic.Component<'svg', ScoreLineGaugeProps, {}, Enhances> & {
|
|
54
|
-
Segment: Intergalactic.Component<NSBox.Component, SegmentProps>;
|
|
55
|
-
};
|
|
56
|
-
export {};
|
|
57
|
-
//# sourceMappingURL=Line.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.types.d.ts","sourceRoot":"","sources":["../../../../src/component/score/Line.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,mBAAmB,MAAM,sDAAsD,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,KAAK,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,GACjF,GAAG,CAAC,MAAM,CAAC,GACX,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAE1C,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAErF,MAAM,MAAM,YAAY,GAAG,uBAAuB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;A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E,QAAQ,CAAC,GAAG;IACnG,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;CACjE,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export type CommonScoreProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Value of score (in percents from 0 to 100) or count of selected segments (for Line with segments)
|
|
4
|
-
*/
|
|
5
|
-
value: number;
|
|
6
|
-
/**
|
|
7
|
-
* Color of value
|
|
8
|
-
*/
|
|
9
|
-
color?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Color of background
|
|
12
|
-
*/
|
|
13
|
-
baseBgColor?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Flag to enable skeleton
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Flag to enable animate of charts
|
|
21
|
-
* @default true
|
|
22
|
-
*/
|
|
23
|
-
animate?: boolean;
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=Score.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Score.d.ts","sourceRoot":"","sources":["../../../../src/component/score/Score.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/score/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Intergalactic } from '@semcore/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Trend, type CommonTrendProps } from './Trend';
|
|
4
|
-
type BarItem = {
|
|
5
|
-
/**
|
|
6
|
-
* Value
|
|
7
|
-
*/
|
|
8
|
-
value: number;
|
|
9
|
-
/**
|
|
10
|
-
* Color of value
|
|
11
|
-
*/
|
|
12
|
-
color?: string;
|
|
13
|
-
};
|
|
14
|
-
export type TrendBarProps = CommonTrendProps & {
|
|
15
|
-
/**
|
|
16
|
-
* Data to bar chart
|
|
17
|
-
*/
|
|
18
|
-
data: BarItem[];
|
|
19
|
-
};
|
|
20
|
-
type TrendBarComponent = Intergalactic.Component<'svg', TrendBarProps, {}, typeof TrendBarRoot.enhance>;
|
|
21
|
-
type TrendBarDefaultProps = {
|
|
22
|
-
animate: true;
|
|
23
|
-
};
|
|
24
|
-
declare class TrendBarRoot extends Trend<TrendBarProps, typeof TrendBarRoot.enhance, TrendBarDefaultProps> {
|
|
25
|
-
static enhance: readonly [(props: any) => any];
|
|
26
|
-
static style: {
|
|
27
|
-
[key: string]: string;
|
|
28
|
-
};
|
|
29
|
-
static defaultProps: {
|
|
30
|
-
readonly animate: true;
|
|
31
|
-
};
|
|
32
|
-
get defaultData(): BarItem[];
|
|
33
|
-
get data(): BarItem[];
|
|
34
|
-
render(): React.ReactNode;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* MiniCharts.TrendBar
|
|
38
|
-
*
|
|
39
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
40
|
-
*/
|
|
41
|
-
export declare const TrendBar: TrendBarComponent;
|
|
42
|
-
/**
|
|
43
|
-
* MiniCharts.TrendHistogram
|
|
44
|
-
*
|
|
45
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
46
|
-
*/
|
|
47
|
-
export declare const TrendHistogram: TrendBarComponent;
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=Bar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Bar.d.ts","sourceRoot":"","sources":["../../../../src/component/trend/Bar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGvD,KAAK,OAAO,GAAG;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG;IAC7C;;OAEG;IACH,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,iBAAiB,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAExG,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,cAAM,YAAa,SAAQ,KAAK,CAAC,aAAa,EAAE,OAAO,YAAY,CAAC,OAAO,EAAE,oBAAoB,CAAC;IAChG,MAAM,CAAC,OAAO,iCAAoC;IAElD,MAAM,CAAC,KAAK;;MAAS;IAErB,MAAM,CAAC,YAAY;;MAER;IAEX,IAAI,WAAW,IAAI,OAAO,EAAE,CAE3B;IAED,IAAI,IAAI,IAAI,OAAO,EAAE,CAQpB;IAED,MAAM;CA6CP;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,mBAGN,CAAC;AAIhB;;;;GAIG;AACH,eAAO,MAAM,cAAc,mBAiB1B,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Intergalactic } from '@semcore/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Trend, type CommonTrendProps } from './Trend';
|
|
4
|
-
export type TrendLineProps = CommonTrendProps & {
|
|
5
|
-
/**
|
|
6
|
-
* List of values
|
|
7
|
-
*/
|
|
8
|
-
data: number[];
|
|
9
|
-
/**
|
|
10
|
-
* Color of line
|
|
11
|
-
*/
|
|
12
|
-
color?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Color of last point in chart
|
|
15
|
-
*/
|
|
16
|
-
lastPointColor?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Radius for last point item
|
|
19
|
-
*/
|
|
20
|
-
lastPointRadius?: number;
|
|
21
|
-
};
|
|
22
|
-
type TrendLineComponent = Intergalactic.Component<'svg', TrendLineProps, {}, typeof TrendLineRoot.enhance>;
|
|
23
|
-
type TrendLineDefaultProps = {
|
|
24
|
-
animate: true;
|
|
25
|
-
};
|
|
26
|
-
declare class TrendLineRoot extends Trend<TrendLineProps, typeof TrendLineRoot.enhance, TrendLineDefaultProps> {
|
|
27
|
-
static enhance: readonly [(props: any) => any, (props: any) => {
|
|
28
|
-
uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
|
|
29
|
-
}];
|
|
30
|
-
static style: {
|
|
31
|
-
[key: string]: string;
|
|
32
|
-
};
|
|
33
|
-
static defaultProps: {
|
|
34
|
-
readonly animate: true;
|
|
35
|
-
};
|
|
36
|
-
get defaultData(): number[];
|
|
37
|
-
get lastPointRadius(): number;
|
|
38
|
-
get data(): number[];
|
|
39
|
-
get svgWidth(): number;
|
|
40
|
-
get svgHeight(): number;
|
|
41
|
-
get color(): any;
|
|
42
|
-
render(): React.ReactNode;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* MiniCharts.TrendLine
|
|
46
|
-
*
|
|
47
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
48
|
-
*/
|
|
49
|
-
export declare const TrendLine: TrendLineComponent;
|
|
50
|
-
/**
|
|
51
|
-
* MiniCharts.TrendArea
|
|
52
|
-
*
|
|
53
|
-
* {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-api#trend-charts|API} | {@link https://developer.semrush.com/intergalactic/data-display/mini-chart/mini-chart-code|Examples}
|
|
54
|
-
*/
|
|
55
|
-
export declare const TrendArea: TrendLineComponent;
|
|
56
|
-
export {};
|
|
57
|
-
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/component/trend/Line.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGvD,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG;IAC9C;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,kBAAkB,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAE3G,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,cAAM,aAAc,SAAQ,KAAK,CAAC,cAAc,EAAE,OAAO,aAAa,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACpG,MAAM,CAAC,OAAO;;OAA2D;IAEzE,MAAM,CAAC,KAAK;;MAAS;IAErB,MAAM,CAAC,YAAY;;MAER;IAEX,IAAI,WAAW,IAAI,MAAM,EAAE,CAE1B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,IAAI,IAAI,MAAM,EAAE,CAQnB;IAED,IAAa,QAAQ,IAAI,MAAM,CAI9B;IAED,IAAa,SAAS,IAAI,MAAM,CAI/B;IAED,IAAI,KAAK,QAQR;IAED,MAAM;CA8DP;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,oBAA2E,CAAC;AAIlG;;;;GAIG;AACH,eAAO,MAAM,SAAS,oBAcrB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { NSBox } from '@semcore/base-components';
|
|
2
|
-
import type { Intergalactic } from '@semcore/core';
|
|
3
|
-
import { Component } from '@semcore/core';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
export type CommonTrendProps = NSBox.Props & {
|
|
6
|
-
/**
|
|
7
|
-
* Flag to enable animate of charts
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
animate?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Flag to enable skeleton
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Data for chart
|
|
18
|
-
*/
|
|
19
|
-
data: any[];
|
|
20
|
-
};
|
|
21
|
-
type CommonTrendState = {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
export declare abstract class Trend<P extends CommonTrendProps, E extends readonly ((...args: any[]) => any)[], DP extends Intergalactic.InternalTypings.ValidDefaultProps<DP, P> = never> extends Component<P, E, Readonly<{}>, {}, CommonTrendState, DP> {
|
|
26
|
-
state: {
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
};
|
|
30
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
31
|
-
componentDidMount(): void;
|
|
32
|
-
componentDidUpdate(prevProps: P): void;
|
|
33
|
-
get defaultWidth(): number;
|
|
34
|
-
get defaultHeight(): number;
|
|
35
|
-
get svgWidth(): number;
|
|
36
|
-
get svgHeight(): number;
|
|
37
|
-
setSizes(): void;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=Trend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Trend.d.ts","sourceRoot":"","sources":["../../../../src/component/trend/Trend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,GAAG;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,GAAG,EAAE,CAAC;CACb,CAAC;AAEF,KAAK,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,8BAAsB,KAAK,CACzB,CAAC,SAAS,gBAAgB,EAC1B,CAAC,SAAS,SAAS,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,EAC9C,EAAE,SAAS,aAAa,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CACzE,SAAQ,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,CAAC;IAC/D,KAAK;;;MAGH;IAEF,YAAY,kCAAqC;IAEjD,iBAAiB;IAIjB,kBAAkB,CAAC,SAAS,EAAE,CAAC;IAU/B,IAAI,YAAY,IAAI,MAAM,CAIzB;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,QAAQ;CAWT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/trend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|