@semcore/d3-chart 17.3.1 → 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 +6 -0
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +55 -58
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +14 -11
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +158 -39
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +6 -4
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +20 -11
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +139 -50
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +12 -10
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +9 -7
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +21 -8
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +33 -30
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +2 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +5 -4
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +6 -4
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +9 -7
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +3 -2
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +19 -7
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +6 -5
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +4 -2
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +23 -18
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +12 -8
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/cjs/style/abstract-chart.shadow.css +31 -1
- package/lib/cjs/style/area.shadow.css +6 -5
- package/lib/cjs/style/axis.shadow.css +2 -2
- package/lib/cjs/style/bar.shadow.css +7 -7
- package/lib/cjs/style/bubble.shadow.css +4 -4
- package/lib/cjs/style/donut.shadow.css +3 -3
- package/lib/cjs/style/dot.shadow.css +9 -3
- package/lib/cjs/style/hover.shadow.css +19 -1
- package/lib/cjs/style/line.shadow.css +4 -4
- package/lib/cjs/style/radar.shadow.css +5 -5
- package/lib/cjs/style/radial-tree.shadow.css +3 -3
- package/lib/cjs/style/reference.shadow.css +1 -1
- package/lib/cjs/style/scatterplot.shadow.css +1 -1
- package/lib/cjs/style/tooltip.shadow.css +23 -14
- package/lib/cjs/style/venn.shadow.css +3 -3
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/utils/TextMeasurer.js +33 -0
- package/lib/cjs/utils/TextMeasurer.js.map +1 -0
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +55 -57
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +14 -11
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +158 -39
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +6 -4
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +20 -11
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +136 -48
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +12 -10
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +9 -7
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +22 -9
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +33 -30
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +2 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +5 -4
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +6 -4
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +9 -7
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +3 -2
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +20 -8
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +6 -5
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +4 -2
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +23 -18
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +12 -8
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/es6/style/abstract-chart.shadow.css +31 -1
- package/lib/es6/style/area.shadow.css +6 -5
- package/lib/es6/style/axis.shadow.css +2 -2
- package/lib/es6/style/bar.shadow.css +7 -7
- package/lib/es6/style/bubble.shadow.css +4 -4
- package/lib/es6/style/donut.shadow.css +3 -3
- package/lib/es6/style/dot.shadow.css +9 -3
- package/lib/es6/style/hover.shadow.css +19 -1
- package/lib/es6/style/line.shadow.css +4 -4
- package/lib/es6/style/radar.shadow.css +5 -5
- package/lib/es6/style/radial-tree.shadow.css +3 -3
- package/lib/es6/style/reference.shadow.css +1 -1
- package/lib/es6/style/scatterplot.shadow.css +1 -1
- package/lib/es6/style/tooltip.shadow.css +23 -14
- package/lib/es6/style/venn.shadow.css +3 -3
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/utils/TextMeasurer.js +25 -0
- package/lib/es6/utils/TextMeasurer.js.map +1 -0
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +56 -58
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +10 -10
- package/lib/esm/Dots.mjs +15 -12
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +157 -40
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +7 -5
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +21 -12
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +150 -54
- package/lib/esm/component/Chart/AreaChart.mjs +12 -10
- package/lib/esm/component/Chart/BarChart.mjs +9 -7
- package/lib/esm/component/Chart/BubbleChart.mjs +29 -9
- package/lib/esm/component/Chart/CigaretteChart.mjs +33 -30
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
- package/lib/esm/component/Chart/DonutChart.mjs +5 -4
- package/lib/esm/component/Chart/HistogramChart.mjs +6 -4
- package/lib/esm/component/Chart/LineChart.mjs +9 -7
- package/lib/esm/component/Chart/RadarChart.mjs +3 -2
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +25 -8
- package/lib/esm/component/Chart/VennChart.mjs +6 -5
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +4 -2
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +24 -19
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +13 -9
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/esm/style/abstract-chart.shadow.css +31 -1
- package/lib/esm/style/area.shadow.css +6 -5
- package/lib/esm/style/axis.shadow.css +2 -2
- package/lib/esm/style/bar.shadow.css +7 -7
- package/lib/esm/style/bubble.shadow.css +4 -4
- package/lib/esm/style/donut.shadow.css +3 -3
- package/lib/esm/style/dot.shadow.css +9 -3
- package/lib/esm/style/hover.shadow.css +19 -1
- package/lib/esm/style/line.shadow.css +4 -4
- package/lib/esm/style/radar.shadow.css +5 -5
- package/lib/esm/style/radial-tree.shadow.css +3 -3
- package/lib/esm/style/reference.shadow.css +1 -1
- package/lib/esm/style/scatterplot.shadow.css +1 -1
- package/lib/esm/style/tooltip.shadow.css +23 -14
- package/lib/esm/style/venn.shadow.css +3 -3
- package/lib/esm/utils/TextMeasurer.mjs +27 -0
- package/lib/types/Hover.d.ts +2 -0
- package/lib/types/component/Chart/AbstractChart.d.ts +11 -6
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +20 -2
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -0
- package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -0
- package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +2 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +2 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +2 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/RadarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +2 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +2 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +2 -1
- package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +5 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +3 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +2 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
- package/lib/types/utils/TextMeasurer.d.ts +5 -0
- package/lib/types/utils/TextMeasurer.d.ts.map +1 -0
- package/package.json +15 -15
package/lib/cjs/Plot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_resolveColorEnhance","_eventEmitter","_react","_hints","_PlotA11yModule","_intergalacticDynamicLocales","_utils","style","sstyled","insert","PlotRoot","Component","constructor","props","_defineProperty2","default","uniqueId","React","createRef","dataHints","makeDataHintsContainer","makeDataHintsHandlers","dataStructureHints","e","scale","asProps","eventEmitter","emit","length","xScale","yScale","pX","pY","eventToPoint","rootRef","current","minX","maxX","range","maxY","minY","EventEmitter","setContext","data","width","height","locale","resolveColor","patterns","duration","yScaleDomain","domain","dataHintsHandler","setPointsDensity","Math","abs","$rootProps","size","plotId","render","_ref","_ref2","SPlot","Box","styles","Children","a11yAltTextConfig","label","getI18nText","ariaLabel","createElement","cn","assignProps","handlerMouseMove","handlerMouseLeave","PlotA11yModule","colorResolverEnhance","i18nEnhance","localizedMessages","_default","exports","createComponent"],"sources":["../../src/Plot.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport colorResolverEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport React from 'react';\n\nimport { makeDataHintsHandlers, makeDataHintsContainer } from './a11y/hints';\nimport { PlotA11yModule } from './a11y/PlotA11yModule';\nimport style from './style/plot.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { eventToPoint, uniqueId } from './utils';\n\nclass PlotRoot extends Component {\n static displayName = 'Plot';\n static style = style;\n\n constructor(props) {\n super(props);\n this.eventEmitter = props.eventEmitter || new EventEmitter();\n }\n\n static defaultProps = () => ({\n width: 0,\n height: 0,\n });\n\n static enhance = [colorResolverEnhance(), i18nEnhance(localizedMessages)];\n\n plotId = uniqueId();\n\n rootRef = React.createRef();\n\n dataStructureHints = this.props.dataHints || makeDataHintsContainer();\n dataHintsHandler = makeDataHintsHandlers(this.dataStructureHints);\n\n handlerMouseMove = (e) => {\n const { scale } = this.asProps;\n this.eventEmitter.emit('onMouseMoveRoot', e);\n\n if (scale && scale.length >= 2) {\n const [xScale, yScale] = scale;\n const [pX, pY] = eventToPoint(e, this.rootRef.current);\n const [minX, maxX] = xScale.range();\n const [maxY, minY] = yScale.range();\n\n if (pX >= minX && pX <= maxX && pY >= minY
|
|
1
|
+
{"version":3,"file":"Plot.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_resolveColorEnhance","_eventEmitter","_react","_hints","_PlotA11yModule","_intergalacticDynamicLocales","_utils","style","sstyled","insert","PlotRoot","Component","constructor","props","_defineProperty2","default","uniqueId","React","createRef","dataHints","makeDataHintsContainer","makeDataHintsHandlers","dataStructureHints","e","scale","asProps","eventEmitter","emit","length","xScale","yScale","pX","pY","eventToPoint","rootRef","current","minX","maxX","range","maxY","minY","isTickUnder","EventEmitter","setContext","data","width","height","locale","resolveColor","patterns","duration","yScaleDomain","domain","dataHintsHandler","setPointsDensity","Math","abs","$rootProps","size","plotId","render","_ref","_ref2","SPlot","Box","styles","Children","a11yAltTextConfig","label","getI18nText","ariaLabel","createElement","cn","assignProps","handlerMouseMove","handlerMouseLeave","PlotA11yModule","colorResolverEnhance","i18nEnhance","localizedMessages","_default","exports","createComponent"],"sources":["../../src/Plot.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport colorResolverEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport React from 'react';\n\nimport { makeDataHintsHandlers, makeDataHintsContainer } from './a11y/hints';\nimport { PlotA11yModule } from './a11y/PlotA11yModule';\nimport style from './style/plot.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { eventToPoint, uniqueId } from './utils';\n\nclass PlotRoot extends Component {\n static displayName = 'Plot';\n static style = style;\n\n constructor(props) {\n super(props);\n this.eventEmitter = props.eventEmitter || new EventEmitter();\n }\n\n static defaultProps = () => ({\n width: 0,\n height: 0,\n });\n\n static enhance = [colorResolverEnhance(), i18nEnhance(localizedMessages)];\n\n plotId = uniqueId();\n\n rootRef = React.createRef();\n\n dataStructureHints = this.props.dataHints || makeDataHintsContainer();\n dataHintsHandler = makeDataHintsHandlers(this.dataStructureHints);\n\n handlerMouseMove = (e) => {\n const { scale } = this.asProps;\n this.eventEmitter.emit('onMouseMoveRoot', e);\n\n if (scale && scale.length >= 2) {\n const [xScale, yScale] = scale;\n const [pX, pY] = eventToPoint(e, this.rootRef.current);\n const [minX, maxX] = xScale.range();\n const [maxY, minY] = yScale.range();\n\n if (pX >= minX && pX <= maxX && pY >= minY) {\n const isTickUnder = pY >= maxY;\n\n this.eventEmitter.emit('onMouseMoveChart', e, this.rootRef.current, isTickUnder);\n } else {\n this.eventEmitter.emit('onMouseLeaveChart', e);\n }\n }\n };\n\n handlerMouseLeave = (e) => {\n this.eventEmitter.emit('onMouseLeaveRoot', e);\n this.eventEmitter.emit('onMouseLeaveChart', e);\n };\n\n setContext() {\n const { scale, data, width, height, locale, resolveColor, patterns, duration } = this.asProps;\n\n const yScaleDomain = scale?.[1]?.domain?.();\n if (yScaleDomain?.length && data?.length) {\n this.dataHintsHandler.setPointsDensity(\n data.length / width,\n Math.abs(yScaleDomain[1] - yScaleDomain[0]) / height,\n );\n }\n\n return {\n $rootProps: {\n size: [width, height],\n data: data,\n locale,\n scale: scale,\n eventEmitter: this.eventEmitter,\n rootRef: this.rootRef,\n dataHintsHandler: this.dataHintsHandler,\n dataHints: this.dataStructureHints,\n resolveColor,\n patterns,\n duration,\n plotId: this.plotId,\n },\n };\n }\n\n render() {\n const SPlot = Root;\n const { styles, width, height, Children, data, a11yAltTextConfig, label, locale, getI18nText } =\n this.asProps;\n\n if (!width || !height) return null;\n\n const ariaLabel = label ?? getI18nText('d3Chart.Plot:aria-label');\n\n return sstyled(styles)(\n <SPlot\n render={Box}\n tag='svg'\n __excludeProps={['data', 'scale']}\n ref={this.rootRef}\n onMouseMove={this.handlerMouseMove}\n onMouseLeave={this.handlerMouseLeave}\n aria-label={ariaLabel}\n data-plot-id={this.plotId}\n >\n <Children />\n <foreignObject width='100%' height='100%' data-aria-only>\n <PlotA11yModule\n id={this.plotId}\n payload={data}\n plotLabel={label}\n locale={locale}\n plotRef={this.rootRef}\n hints={this.dataStructureHints}\n config={a11yAltTextConfig}\n />\n </foreignObject>\n </SPlot>,\n );\n }\n}\n\n/**\n * Plot\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/d3-chart/d3-chart-api#plot|API} | {@link https://developer.semrush.com/intergalactic/data-display/d3-chart/d3-chart-code#chart-plot|Examples}\n */\nexport default createComponent(Plot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EAACxE,QAAQ,CAAC","ignoreList":[]}
|
package/lib/cjs/Radar.js
CHANGED
|
@@ -21,27 +21,27 @@ var _Pattern = require("./Pattern");
|
|
|
21
21
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
22
22
|
var _utils = require("./utils");
|
|
23
23
|
/*!__reshadow-styles__:"./style/radar.shadow.css"*/
|
|
24
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
24
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SAxisLine_1hpm6_gg_,.___SAxisTick_1hpm6_gg_,.___SAxis_1hpm6_gg_{stroke:var(--intergalactic-chart-grid-line,oklch(.95 .002 180));stroke-width:1;fill:#0000}.___SAxisLine_1hpm6_gg_,.___SAxisTick_1hpm6_gg_{stroke-dasharray:2}.___SAxisLine_1hpm6_gg_.__active_1hpm6_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line,oklch(.88 .002 175.6))}.___SAxisLabel_1hpm6_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_1hpm6_gg_.__xDirection_1hpm6_gg_{text-anchor:var(--xDirection_1hpm6)}.___SAxisLabel_1hpm6_gg_.__yDirection_1hpm6_gg_{dominant-baseline:var(--yDirection_1hpm6)}.___SPolygon_1hpm6_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));opacity:.2}.___SPolygon_1hpm6_gg_.__color_1hpm6_gg_{fill:var(--color_1hpm6)}.___SPolygon_1hpm6_gg_.__pattern_1hpm6_gg_.__color_1hpm6_gg_{fill:var(--pattern_1hpm6);stroke:var(--color_1hpm6);stroke-width:1px}.___SPolygonDot_1hpm6_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border,#fff);r:6px;fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140))}.___SPolygonDot_1hpm6_gg_.__transparent_1hpm6_gg_{opacity:.3}.___SPolygonDot_1hpm6_gg_.__color_1hpm6_gg_{fill:var(--color_1hpm6)}.___SPolygonLine_1hpm6_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));stroke-width:3;fill:#0000}.___SPolygonLine_1hpm6_gg_.__transparent_1hpm6_gg_{opacity:.3}.___SPolygonLine_1hpm6_gg_.__color_1hpm6_gg_{stroke:var(--color_1hpm6)}.___SPieRect_1hpm6_gg_{outline:none;fill:var(--intergalactic-chart-grid-bar-chart-hover,oklch(.177 .033 175.6/.042))}", /*__inner_css_end__*/"1hpm6_gg_"),
|
|
25
25
|
/*__reshadow_css_end__*/
|
|
26
26
|
{
|
|
27
|
-
"__SAxis": "
|
|
28
|
-
"__SAxisLine": "
|
|
29
|
-
"__SAxisTick": "
|
|
30
|
-
"_active": "
|
|
31
|
-
"__SAxisLabel": "
|
|
32
|
-
"_xDirection": "
|
|
33
|
-
"--xDirection": "--
|
|
34
|
-
"_yDirection": "
|
|
35
|
-
"--yDirection": "--
|
|
36
|
-
"__SPolygon": "
|
|
37
|
-
"_color": "
|
|
38
|
-
"--color": "--
|
|
39
|
-
"_pattern": "
|
|
40
|
-
"--pattern": "--
|
|
41
|
-
"__SPolygonDot": "
|
|
42
|
-
"_transparent": "
|
|
43
|
-
"__SPolygonLine": "
|
|
44
|
-
"__SPieRect": "
|
|
27
|
+
"__SAxis": "___SAxis_1hpm6_gg_",
|
|
28
|
+
"__SAxisLine": "___SAxisLine_1hpm6_gg_",
|
|
29
|
+
"__SAxisTick": "___SAxisTick_1hpm6_gg_",
|
|
30
|
+
"_active": "__active_1hpm6_gg_",
|
|
31
|
+
"__SAxisLabel": "___SAxisLabel_1hpm6_gg_",
|
|
32
|
+
"_xDirection": "__xDirection_1hpm6_gg_",
|
|
33
|
+
"--xDirection": "--xDirection_1hpm6",
|
|
34
|
+
"_yDirection": "__yDirection_1hpm6_gg_",
|
|
35
|
+
"--yDirection": "--yDirection_1hpm6",
|
|
36
|
+
"__SPolygon": "___SPolygon_1hpm6_gg_",
|
|
37
|
+
"_color": "__color_1hpm6_gg_",
|
|
38
|
+
"--color": "--color_1hpm6",
|
|
39
|
+
"_pattern": "__pattern_1hpm6_gg_",
|
|
40
|
+
"--pattern": "--pattern_1hpm6",
|
|
41
|
+
"__SPolygonDot": "___SPolygonDot_1hpm6_gg_",
|
|
42
|
+
"_transparent": "__transparent_1hpm6_gg_",
|
|
43
|
+
"__SPolygonLine": "___SPolygonLine_1hpm6_gg_",
|
|
44
|
+
"__SPieRect": "___SPieRect_1hpm6_gg_"
|
|
45
45
|
});
|
|
46
46
|
const clampAngle = angle => {
|
|
47
47
|
angle = angle % (2 * Math.PI);
|
package/lib/cjs/RadialTree.js
CHANGED
|
@@ -17,20 +17,20 @@ var _createElement = _interopRequireDefault(require("./createElement"));
|
|
|
17
17
|
var _Pattern = require("./Pattern");
|
|
18
18
|
var _utils = require("./utils");
|
|
19
19
|
/*!__reshadow-styles__:"./style/radial-tree.shadow.css"*/
|
|
20
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
20
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SRadian_ojwuj_gg_{cursor:pointer;fill:var(--intergalactic-text-large-info,oklch(.6 .166 277.7))}.___SLine_ojwuj_gg_{stroke:var(--intergalactic-text-large-info,oklch(.6 .166 277.7))}.___SLine_ojwuj_gg_.__stroke_ojwuj_gg_{stroke:var(--stroke_ojwuj)}.___SLine_ojwuj_gg_.__transparent_ojwuj_gg_{opacity:.3}.___SCap_ojwuj_gg_{transition:r .1s}.___SCap_ojwuj_gg_.__pattern_ojwuj_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:1px}.___SCap_ojwuj_gg_.__transparent_ojwuj_gg_,.___SIcon_ojwuj_gg_.__transparent_ojwuj_gg_{opacity:.3}.___SLabel_ojwuj_gg_{fill:var(--color_ojwuj)}.___SLabel_ojwuj_gg_.__transparent_ojwuj_gg_{opacity:.3}@media (hover:hover){.___SRadian_ojwuj_gg_:hover .___SLabel_ojwuj_gg_{cursor:pointer;filter:brightness(.6)}}@media (prefers-reduced-motion){.___SLineCap_ojwuj_gg_{transition:none}}", /*__inner_css_end__*/"ojwuj_gg_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SRadian": "
|
|
24
|
-
"__SLine": "
|
|
25
|
-
"_stroke": "
|
|
26
|
-
"--stroke": "--
|
|
27
|
-
"_transparent": "
|
|
28
|
-
"__SCap": "
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"__SIcon": "
|
|
31
|
-
"__SLabel": "
|
|
32
|
-
"--color": "--
|
|
33
|
-
"__SLineCap": "
|
|
23
|
+
"__SRadian": "___SRadian_ojwuj_gg_",
|
|
24
|
+
"__SLine": "___SLine_ojwuj_gg_",
|
|
25
|
+
"_stroke": "__stroke_ojwuj_gg_",
|
|
26
|
+
"--stroke": "--stroke_ojwuj",
|
|
27
|
+
"_transparent": "__transparent_ojwuj_gg_",
|
|
28
|
+
"__SCap": "___SCap_ojwuj_gg_",
|
|
29
|
+
"_pattern": "__pattern_ojwuj_gg_",
|
|
30
|
+
"__SIcon": "___SIcon_ojwuj_gg_",
|
|
31
|
+
"__SLabel": "___SLabel_ojwuj_gg_",
|
|
32
|
+
"--color": "--color_ojwuj",
|
|
33
|
+
"__SLineCap": "___SLineCap_ojwuj_gg_"
|
|
34
34
|
});
|
|
35
35
|
const baseAngle = -Math.PI / 2; // The top vertical line
|
|
36
36
|
|
package/lib/cjs/Reference.js
CHANGED
|
@@ -12,20 +12,20 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _createElement = _interopRequireDefault(require("./createElement"));
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
/*!__reshadow-styles__:"./style/reference.shadow.css"*/
|
|
15
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
15
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SReferenceLine_1ycra_gg_{fill:none;stroke:var(--intergalactic-chart-grid-y-accent-hover-line,oklch(.88 .002 175.6))}.___STitle_1ycra_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,oklch(.097 .023 156.5/.468));transform-origin:var(--transform-origin_1ycra)}.___STitle_1ycra_gg_._position_top_1ycra_gg_{text-anchor:middle}.___STitle_1ycra_gg_._position_bottom_1ycra_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_1ycra_gg_._position_left_1ycra_gg_,.___STitle_1ycra_gg_._position_right_1ycra_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___SBackground_1ycra_gg_{fill:var(--intergalactic-chart-grid-period-bg,oklch(.96 .001 180))}.___SStripes_1ycra_gg_{fill:var(--fill_1ycra)}.___SStripesPatternPath_1ycra_gg_{stroke:var(--intergalactic-chart-grid-period-pattern,oklch(.95 .002 180));stroke-width:1px}", /*__inner_css_end__*/"1ycra_gg_"),
|
|
16
16
|
/*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SReferenceLine": "
|
|
19
|
-
"__STitle": "
|
|
20
|
-
"--transform-origin": "--transform-
|
|
21
|
-
"_position_top": "
|
|
22
|
-
"_position_bottom": "
|
|
23
|
-
"_position_right": "
|
|
24
|
-
"_position_left": "
|
|
25
|
-
"__SBackground": "
|
|
26
|
-
"__SStripes": "
|
|
27
|
-
"--fill": "--
|
|
28
|
-
"__SStripesPatternPath": "
|
|
18
|
+
"__SReferenceLine": "___SReferenceLine_1ycra_gg_",
|
|
19
|
+
"__STitle": "___STitle_1ycra_gg_",
|
|
20
|
+
"--transform-origin": "--transform-origin_1ycra",
|
|
21
|
+
"_position_top": "_position_top_1ycra_gg_",
|
|
22
|
+
"_position_bottom": "_position_bottom_1ycra_gg_",
|
|
23
|
+
"_position_right": "_position_right_1ycra_gg_",
|
|
24
|
+
"_position_left": "_position_left_1ycra_gg_",
|
|
25
|
+
"__SBackground": "___SBackground_1ycra_gg_",
|
|
26
|
+
"__SStripes": "___SStripes_1ycra_gg_",
|
|
27
|
+
"--fill": "--fill_1ycra",
|
|
28
|
+
"__SStripesPatternPath": "___SStripesPatternPath_1ycra_gg_"
|
|
29
29
|
});
|
|
30
30
|
const side2direction = {
|
|
31
31
|
left: 'vertical',
|
package/lib/cjs/ScatterPlot.js
CHANGED
|
@@ -16,17 +16,17 @@ var _Pattern = require("./Pattern");
|
|
|
16
16
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
17
17
|
var _utils = require("./utils");
|
|
18
18
|
/*!__reshadow-styles__:"./style/scatterplot.shadow.css"*/
|
|
19
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
19
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SScatterPlot_1kxs7_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));transition-property:cx,cy;transition-duration:var(--duration_1kxs7);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SScatterPlot_1kxs7_gg_:hover{opacity:.8}}.___SScatterPlot_1kxs7_gg_.__color_1kxs7_gg_{fill:var(--color_1kxs7)}.___SScatterPlot_1kxs7_gg_.__pattern_1kxs7_gg_.__color_1kxs7_gg_{fill:var(--pattern_1kxs7);stroke:var(--color_1kxs7);stroke-width:1px}.___SScatterPlot_1kxs7_gg_.__transparent_1kxs7_gg_{opacity:.3}.___SValue_1kxs7_gg_{text-anchor:middle;font-size:var(--intergalactic-fs-50,10px);stroke:var(--intergalactic-chart-palette-order-9,oklch(.53 .157 279.2))}.___SValue_1kxs7_gg_.__color_1kxs7_gg_{stroke:var(--color_1kxs7)}.___SValue_1kxs7_gg_.__transparent_1kxs7_gg_{opacity:.3}", /*__inner_css_end__*/"1kxs7_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SScatterPlot": "
|
|
23
|
-
"_color": "
|
|
24
|
-
"--color": "--
|
|
25
|
-
"_pattern": "
|
|
26
|
-
"--pattern": "--
|
|
27
|
-
"_transparent": "
|
|
28
|
-
"__SValue": "
|
|
29
|
-
"--duration": "--
|
|
22
|
+
"__SScatterPlot": "___SScatterPlot_1kxs7_gg_",
|
|
23
|
+
"_color": "__color_1kxs7_gg_",
|
|
24
|
+
"--color": "--color_1kxs7",
|
|
25
|
+
"_pattern": "__pattern_1kxs7_gg_",
|
|
26
|
+
"--pattern": "--pattern_1kxs7",
|
|
27
|
+
"_transparent": "__transparent_1kxs7_gg_",
|
|
28
|
+
"__SValue": "___SValue_1kxs7_gg_",
|
|
29
|
+
"--duration": "--duration_1kxs7"
|
|
30
30
|
});
|
|
31
31
|
class ScatterPlotRoot extends _core.Component {
|
|
32
32
|
constructor(...args) {
|
package/lib/cjs/Tooltip.js
CHANGED
|
@@ -15,17 +15,20 @@ var _createElement = _interopRequireDefault(require("./createElement"));
|
|
|
15
15
|
var _Pattern = require("./Pattern");
|
|
16
16
|
var _utils = require("./utils");
|
|
17
17
|
/*!__reshadow-styles__:"./style/tooltip.shadow.css"*/
|
|
18
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
18
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___STooltip_oee7t_gg_{font-size:var(--intergalactic-fs-100,12px);line-height:var(--intergalactic-lh-100,1.3334);font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;position:relative;color:var(--intergalactic-text-primary-invert,oklch(.999 .001 180/.949));background-color:var(--intergalactic-tooltip-bg-invert,oklch(.23 .01 140));border-radius:var(--intergalactic-popper-rounded,6px);border:1px solid var(--intergalactic-tooltip-border-invert,oklch(.4 .004 140));box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper,1px 1px 10px 0 #00151012);padding:var(--intergalactic-spacing-content-padding-medium,12px)}@media (color-gamut:p3){.___STooltip_oee7t_gg_{box-shadow:var(--intergalactic-box-shadow-popper,1px 1px 10px 0 oklch(.176 .033 175.7/.07))}}.___STitle_oee7t_gg_{color:var(--intergalactic-text-secondary-invert,oklch(.997 .004 165.9/.684));margin-bottom:var(--intergalactic-spacing-content-gap-large,8px)}.___SDotGroup_oee7t_gg_{display:flex;align-items:center}.___SDot_oee7t_gg_{margin-right:var(--intergalactic-spacing-content-gap-large,8px)}.___SDotCircle_oee7t_gg_.__color_oee7t_gg_.__lightness_oee7t_gg_{background-color:var(--color_oee7t);width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 1px oklch(from var(--color_oee7t) calc(l + var(--lightness_oee7t)) c h)}.___SFooter_oee7t_gg_{background:var(--intergalactic-bg-secondary-invert,oklch(.969 .057 140/.118));color:var(--intergalactic-text-secondary-invert,oklch(.997 .004 165.9/.684));padding:var(--intergalactic-spacing-content-padding-xsmall,4px) var(--intergalactic-spacing-content-padding-medium,12px);border-radius:0 0 var(--intergalactic-rounded-medium,6px) var(--intergalactic-rounded-medium,6px);margin:var(--intergalactic-spacing-content-gap-xlarge,12px) calc(var(--intergalactic-spacing-content-gap-xlarge, 12px)*-1) calc(var(--intergalactic-spacing-content-gap-xlarge, 12px)*-1)}.___SDotPattern_oee7t_gg_{stroke-width:1px;stroke:oklch(from var(--intergalactic-chart-grid-border,#fff) l c h/.5)}", /*__inner_css_end__*/"oee7t_gg_"),
|
|
19
19
|
/*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__STooltip": "
|
|
22
|
-
"__STitle": "
|
|
23
|
-
"__SDotGroup": "
|
|
24
|
-
"__SDot": "
|
|
25
|
-
"__SDotCircle": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"
|
|
28
|
-
"
|
|
21
|
+
"__STooltip": "___STooltip_oee7t_gg_",
|
|
22
|
+
"__STitle": "___STitle_oee7t_gg_",
|
|
23
|
+
"__SDotGroup": "___SDotGroup_oee7t_gg_",
|
|
24
|
+
"__SDot": "___SDot_oee7t_gg_",
|
|
25
|
+
"__SDotCircle": "___SDotCircle_oee7t_gg_",
|
|
26
|
+
"_color": "__color_oee7t_gg_",
|
|
27
|
+
"_lightness": "__lightness_oee7t_gg_",
|
|
28
|
+
"--color": "--color_oee7t",
|
|
29
|
+
"--lightness": "--lightness_oee7t",
|
|
30
|
+
"__SFooter": "___SFooter_oee7t_gg_",
|
|
31
|
+
"__SDotPattern": "___SDotPattern_oee7t_gg_"
|
|
29
32
|
});
|
|
30
33
|
/**
|
|
31
34
|
* `TooltipDotRenderContext` is a hack to bypass problem that getDotProps doesn't work for D3 tooltip.
|
|
@@ -212,6 +215,10 @@ function Title(props) {
|
|
|
212
215
|
}));
|
|
213
216
|
}
|
|
214
217
|
Title.style = style;
|
|
218
|
+
const CHART_PALETTE_ORDER_TO_LIGHTNESS = {
|
|
219
|
+
'chart-palette-order-1': 0.35,
|
|
220
|
+
'DEFAULT': 0.15
|
|
221
|
+
};
|
|
215
222
|
function Dot(props) {
|
|
216
223
|
var _ref4 = arguments[0],
|
|
217
224
|
_ref8;
|
|
@@ -232,16 +239,18 @@ function Dot(props) {
|
|
|
232
239
|
const SDotGroup = _baseComponents.Box;
|
|
233
240
|
const SDot = _baseComponents.Box;
|
|
234
241
|
const SDotCircle = _baseComponents.Box;
|
|
242
|
+
const SDotPattern = _Pattern.PatternSymbol;
|
|
235
243
|
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SDotGroup, _ref8.cn("SDotGroup", {
|
|
236
244
|
...(0, _core.assignProps)({
|
|
237
245
|
"use:color": undefined,
|
|
238
246
|
"__excludeProps": ['data', 'scale']
|
|
239
247
|
}, _ref4)
|
|
240
|
-
}), patterns ? /*#__PURE__*/_react.default.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/_react.default.createElement(
|
|
248
|
+
}), patterns ? /*#__PURE__*/_react.default.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/_react.default.createElement(SDotPattern, _ref8.cn("SDotPattern", {
|
|
241
249
|
"color": resolveColor(color ?? defaultColor),
|
|
242
250
|
"patternKey": color ?? defaultColor
|
|
243
251
|
}))) : /*#__PURE__*/_react.default.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/_react.default.createElement(SDotCircle, _ref8.cn("SDotCircle", {
|
|
244
|
-
"color": resolveColor(color ?? defaultColor)
|
|
252
|
+
"color": resolveColor(color ?? defaultColor),
|
|
253
|
+
"lightness": CHART_PALETTE_ORDER_TO_LIGHTNESS[color ?? defaultColor] ?? CHART_PALETTE_ORDER_TO_LIGHTNESS.DEFAULT
|
|
245
254
|
}))), /*#__PURE__*/_react.default.createElement(Children, _ref8.cn("Children", {})));
|
|
246
255
|
}
|
|
247
256
|
Dot.style = style;
|
package/lib/cjs/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":["_core","require","_baseComponents","_findComponent","_interopRequireDefault","_useColorResolver","_react","_createElement","_Pattern","_utils","style","sstyled","insert","TooltipDotRenderContext","React","createContext","index","indexKeysCache","Set","TooltipRoot","Component","constructor","args","_defineProperty2","default","$visible","anchorProps","tooltipProps","x","y","e","onClick","asProps","xIndex","yIndex","state","getTriggerProps","hideHoverLine","getPopperProps","excludeAnchorProps","componentDidMount","eventEmitter","plotId","unsubscribe","push","subscribe","setState","visible","virtualElementPosition","virtualTriggerElement","setTimeout","setPopperTrigger","getBoundingClientRect","width","height","top","right","bottom","left","popper","current","update","componentWillUnmount","forEach","render","_ref","Children","children","tag","forcedAdvancedMode","_","other","advancedMode","findComponent","Tooltip","Trigger","displayName","Popper","renderContext","clear","patterns","createElement","Provider","value","assignProps","handlerCancel","allowedAutoPlacements","setTrigger","Fragment","handleTriggerClick","PopperTrigger","_ref2","arguments[0]","PopperPopper","props","_ref6","Element","STooltip","styles","useCallback","cn","Title","_ref3","_ref7","STitle","Box","Dot","_ref4","_ref8","color","resolveColor","useColorResolver","useContext","defaultColor","getChartDefaultColorName","key","has","add","SDotGroup","SDot","SDotCircle","undefined","PatternSymbol","Footer","_ref5","_ref9","SFooter","_default","exports"],"sources":["../../src/Tooltip.jsx"],"sourcesContent":["import { Popper, Box } from '@semcore/base-components';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport findComponent from '@semcore/core/lib/utils/findComponent';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport { PatternSymbol } from './Pattern';\nimport style from './style/tooltip.shadow.css';\nimport { getChartDefaultColorName } from './utils';\n\n/**\n * `TooltipDotRenderContext` is a hack to bypass problem that getDotProps doesn't work for D3 tooltip.\n * Probably it may be removed after migrating to a new core.\n */\nconst TooltipDotRenderContext = React.createContext({ index: -1, indexKeysCache: new Set() });\n\nclass TooltipRoot extends Component {\n static displayName = 'Tooltip';\n\n static style = style;\n\n state = {\n $visible: false,\n anchorProps: {},\n tooltipProps: {},\n };\n\n renderContext = { index: -1, indexKeysCache: new Set() };\n\n handlerCancel = () => false;\n\n getTriggerProps() {\n const { x, y, hideHoverLine } = this.asProps;\n return { x, y, hideHoverLine };\n }\n\n getPopperProps() {\n if (this.asProps.excludeAnchorProps) {\n return {\n $visible: this.state.$visible,\n ...this.state.tooltipProps,\n };\n }\n\n return {\n $visible: this.state.$visible,\n ...this.state.anchorProps,\n ...this.state.tooltipProps,\n };\n }\n\n virtualElementPosition = { x: 0, y: 0 };\n virtualTriggerElement = null;\n unsubscribe = [];\n componentDidMount() {\n const { eventEmitter, plotId } = this.asProps;\n\n this.unsubscribe.push(\n eventEmitter.subscribe(`setTooltipRenderingProps_${plotId}`, (anchorProps, tooltipProps) => {\n this.setState({ anchorProps, tooltipProps });\n }),\n eventEmitter.subscribe(`setTooltipVisible_${plotId}`, (visible) =>\n this.setState({ $visible: visible }),\n ),\n eventEmitter.subscribe(`setTooltipPosition_${plotId}`, (x, y) => {\n this.virtualElementPosition.x = x;\n this.virtualElementPosition.y = y;\n if (this.virtualTriggerElement === null) {\n this.virtualTriggerElement = {};\n setTimeout(() => {\n this.setPopperTrigger(this.virtualTriggerElement);\n }, 0);\n }\n this.virtualTriggerElement.getBoundingClientRect = () => {\n const { x, y } = this.virtualElementPosition;\n return { width: 0, height: 0, top: y, right: x, bottom: y, left: x };\n };\n this.popper.current?.update();\n }),\n );\n }\n\n componentWillUnmount() {\n this.unsubscribe.forEach((unsubscribe) => unsubscribe());\n }\n\n handleTriggerClick = (e) => {\n const { onClick } = this.asProps;\n const { xIndex, yIndex } = this.state.tooltipProps;\n\n const index = xIndex ?? yIndex;\n\n onClick?.(index, e);\n };\n\n render() {\n const { Children, children, tag, forcedAdvancedMode, onClick: _, ...other } = this.asProps;\n\n const advancedMode =\n forcedAdvancedMode ||\n !!findComponent(Children, [Tooltip.Trigger.displayName, Tooltip.Popper.displayName]);\n this.renderContext.index = -1;\n this.renderContext.indexKeysCache.clear();\n this.renderContext.patterns = this.asProps.patterns ?? this.state.tooltipProps.patterns;\n\n return (\n <TooltipDotRenderContext.Provider value={this.renderContext}>\n <Root\n render={Popper}\n visible={this.state.$visible}\n onFirstUpdate={this.handlerCancel}\n onOutsideClick={this.handlerCancel}\n interaction='none'\n explicitTriggerSet\n offset={8}\n flip={{ allowedAutoPlacements: ['left', 'right'] }}\n >\n {({ popper, setTrigger }) => {\n this.setPopperTrigger = setTrigger;\n this.popper = popper;\n this.popper.current?.update();\n return advancedMode\n ? (\n <Children />\n )\n : (\n <>\n {tag && <Tooltip.Trigger tag={tag} onClick={this.handleTriggerClick} />}\n <Tooltip.Popper {...other}>{children}</Tooltip.Popper>\n </>\n );\n }}\n </Root>\n </TooltipDotRenderContext.Provider>\n );\n }\n}\n\nfunction PopperTrigger() {\n return <Root render={Popper.Trigger} />;\n}\n\nfunction PopperPopper(props) {\n const { Element: STooltip, styles, $visible, x, y } = props;\n\n const handlerCancel = React.useCallback(() => false, []);\n\n if (!$visible) return null;\n\n return sstyled(styles)(\n <STooltip\n render={Popper.Popper}\n childrenPosition='inside'\n onMouseMove={handlerCancel}\n x={x}\n y={y}\n />,\n );\n}\nPopperPopper.style = style;\n\nfunction Title(props) {\n const STitle = Root;\n const { styles } = props;\n\n return sstyled(styles)(<STitle render={Box} __excludeProps={['data', 'scale']} />);\n}\nTitle.style = style;\n\nfunction Dot(props) {\n const { styles, color, Children } = props;\n const resolveColor = useColorResolver();\n const renderContext = React.useContext(TooltipDotRenderContext);\n const defaultColor = getChartDefaultColorName(renderContext.index);\n const patterns = props.patterns ?? renderContext.patterns;\n\n const key = Children;\n if (!renderContext.indexKeysCache.has(key)) {\n renderContext.indexKeysCache.add(key);\n renderContext.index += 1;\n }\n const SDotGroup = Root;\n const SDot = Box;\n const SDotCircle = Box;\n return sstyled(styles)(\n <SDotGroup render={Box} use:color={undefined} __excludeProps={['data', 'scale']}>\n {patterns\n ? (\n <SDot>\n <PatternSymbol\n color={resolveColor(color ?? defaultColor)}\n patternKey={color ?? defaultColor}\n />\n </SDot>\n )\n : (\n <SDot>\n <SDotCircle color={resolveColor(color ?? defaultColor)} />\n </SDot>\n )}\n <Children />\n </SDotGroup>,\n );\n}\nDot.style = style;\n\nfunction Footer(props) {\n const { styles } = props;\n const SFooter = Root;\n return sstyled(styles)(<SFooter render={Box} __excludeProps={['data', 'scale']} />);\n}\nFooter.style = style;\n\nconst Tooltip = createElement(TooltipRoot, {\n Trigger: PopperTrigger,\n Popper: PopperPopper,\n Title,\n Footer,\n Dot,\n});\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,cAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,O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B;AACF,CAAC,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAxG,OAAA,GAEYkD,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["_core","require","_baseComponents","_findComponent","_interopRequireDefault","_useColorResolver","_react","_createElement","_Pattern","_utils","style","sstyled","insert","TooltipDotRenderContext","React","createContext","index","indexKeysCache","Set","TooltipRoot","Component","constructor","args","_defineProperty2","default","$visible","anchorProps","tooltipProps","x","y","e","onClick","asProps","xIndex","yIndex","state","getTriggerProps","hideHoverLine","getPopperProps","excludeAnchorProps","componentDidMount","eventEmitter","plotId","unsubscribe","push","subscribe","setState","visible","virtualElementPosition","virtualTriggerElement","setTimeout","setPopperTrigger","getBoundingClientRect","width","height","top","right","bottom","left","popper","current","update","componentWillUnmount","forEach","render","_ref","Children","children","tag","forcedAdvancedMode","_","other","advancedMode","findComponent","Tooltip","Trigger","displayName","Popper","renderContext","clear","patterns","createElement","Provider","value","assignProps","handlerCancel","allowedAutoPlacements","setTrigger","Fragment","handleTriggerClick","PopperTrigger","_ref2","arguments[0]","PopperPopper","props","_ref6","Element","STooltip","styles","useCallback","cn","Title","_ref3","_ref7","STitle","Box","CHART_PALETTE_ORDER_TO_LIGHTNESS","Dot","_ref4","_ref8","color","resolveColor","useColorResolver","useContext","defaultColor","getChartDefaultColorName","key","has","add","SDotGroup","SDot","SDotCircle","SDotPattern","PatternSymbol","undefined","DEFAULT","Footer","_ref5","_ref9","SFooter","_default","exports"],"sources":["../../src/Tooltip.jsx"],"sourcesContent":["import { Popper, Box } from '@semcore/base-components';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport findComponent from '@semcore/core/lib/utils/findComponent';\nimport { useColorResolver } from '@semcore/core/lib/utils/use/useColorResolver';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport { PatternSymbol } from './Pattern';\nimport style from './style/tooltip.shadow.css';\nimport { getChartDefaultColorName } from './utils';\n\n/**\n * `TooltipDotRenderContext` is a hack to bypass problem that getDotProps doesn't work for D3 tooltip.\n * Probably it may be removed after migrating to a new core.\n */\nconst TooltipDotRenderContext = React.createContext({ index: -1, indexKeysCache: new Set() });\n\nclass TooltipRoot extends Component {\n static displayName = 'Tooltip';\n\n static style = style;\n\n state = {\n $visible: false,\n anchorProps: {},\n tooltipProps: {},\n };\n\n renderContext = { index: -1, indexKeysCache: new Set() };\n\n handlerCancel = () => false;\n\n getTriggerProps() {\n const { x, y, hideHoverLine } = this.asProps;\n return { x, y, hideHoverLine };\n }\n\n getPopperProps() {\n if (this.asProps.excludeAnchorProps) {\n return {\n $visible: this.state.$visible,\n ...this.state.tooltipProps,\n };\n }\n\n return {\n $visible: this.state.$visible,\n ...this.state.anchorProps,\n ...this.state.tooltipProps,\n };\n }\n\n virtualElementPosition = { x: 0, y: 0 };\n virtualTriggerElement = null;\n unsubscribe = [];\n componentDidMount() {\n const { eventEmitter, plotId } = this.asProps;\n\n this.unsubscribe.push(\n eventEmitter.subscribe(`setTooltipRenderingProps_${plotId}`, (anchorProps, tooltipProps) => {\n this.setState({ anchorProps, tooltipProps });\n }),\n eventEmitter.subscribe(`setTooltipVisible_${plotId}`, (visible) =>\n this.setState({ $visible: visible }),\n ),\n eventEmitter.subscribe(`setTooltipPosition_${plotId}`, (x, y) => {\n this.virtualElementPosition.x = x;\n this.virtualElementPosition.y = y;\n if (this.virtualTriggerElement === null) {\n this.virtualTriggerElement = {};\n setTimeout(() => {\n this.setPopperTrigger(this.virtualTriggerElement);\n }, 0);\n }\n this.virtualTriggerElement.getBoundingClientRect = () => {\n const { x, y } = this.virtualElementPosition;\n return { width: 0, height: 0, top: y, right: x, bottom: y, left: x };\n };\n this.popper.current?.update();\n }),\n );\n }\n\n componentWillUnmount() {\n this.unsubscribe.forEach((unsubscribe) => unsubscribe());\n }\n\n handleTriggerClick = (e) => {\n const { onClick } = this.asProps;\n const { xIndex, yIndex } = this.state.tooltipProps;\n\n const index = xIndex ?? yIndex;\n\n onClick?.(index, e);\n };\n\n render() {\n const { Children, children, tag, forcedAdvancedMode, onClick: _, ...other } = this.asProps;\n\n const advancedMode =\n forcedAdvancedMode ||\n !!findComponent(Children, [Tooltip.Trigger.displayName, Tooltip.Popper.displayName]);\n this.renderContext.index = -1;\n this.renderContext.indexKeysCache.clear();\n this.renderContext.patterns = this.asProps.patterns ?? this.state.tooltipProps.patterns;\n\n return (\n <TooltipDotRenderContext.Provider value={this.renderContext}>\n <Root\n render={Popper}\n visible={this.state.$visible}\n onFirstUpdate={this.handlerCancel}\n onOutsideClick={this.handlerCancel}\n interaction='none'\n explicitTriggerSet\n offset={8}\n flip={{ allowedAutoPlacements: ['left', 'right'] }}\n >\n {({ popper, setTrigger }) => {\n this.setPopperTrigger = setTrigger;\n this.popper = popper;\n this.popper.current?.update();\n return advancedMode\n ? (\n <Children />\n )\n : (\n <>\n {tag && <Tooltip.Trigger tag={tag} onClick={this.handleTriggerClick} />}\n <Tooltip.Popper {...other}>{children}</Tooltip.Popper>\n </>\n );\n }}\n </Root>\n </TooltipDotRenderContext.Provider>\n );\n }\n}\n\nfunction PopperTrigger() {\n return <Root render={Popper.Trigger} />;\n}\n\nfunction PopperPopper(props) {\n const { Element: STooltip, styles, $visible, x, y } = props;\n\n const handlerCancel = React.useCallback(() => false, []);\n\n if (!$visible) return null;\n\n return sstyled(styles)(\n <STooltip\n render={Popper.Popper}\n childrenPosition='inside'\n onMouseMove={handlerCancel}\n x={x}\n y={y}\n />,\n );\n}\nPopperPopper.style = style;\n\nfunction Title(props) {\n const STitle = Root;\n const { styles } = props;\n\n return sstyled(styles)(<STitle render={Box} __excludeProps={['data', 'scale']} />);\n}\nTitle.style = style;\n\nconst CHART_PALETTE_ORDER_TO_LIGHTNESS = {\n 'chart-palette-order-1': 0.35,\n 'DEFAULT': 0.15,\n};\nfunction Dot(props) {\n const { styles, color, Children } = props;\n const resolveColor = useColorResolver();\n const renderContext = React.useContext(TooltipDotRenderContext);\n const defaultColor = getChartDefaultColorName(renderContext.index);\n const patterns = props.patterns ?? renderContext.patterns;\n\n const key = Children;\n if (!renderContext.indexKeysCache.has(key)) {\n renderContext.indexKeysCache.add(key);\n renderContext.index += 1;\n }\n const SDotGroup = Root;\n const SDot = Box;\n const SDotCircle = Box;\n const SDotPattern = PatternSymbol;\n\n return sstyled(styles)(\n <SDotGroup render={Box} use:color={undefined} __excludeProps={['data', 'scale']}>\n {patterns\n ? (\n <SDot>\n <SDotPattern\n color={resolveColor(color ?? defaultColor)}\n patternKey={color ?? defaultColor}\n />\n </SDot>\n )\n : (\n <SDot>\n <SDotCircle\n color={resolveColor(color ?? defaultColor)}\n lightness={CHART_PALETTE_ORDER_TO_LIGHTNESS[color ?? defaultColor] ?? CHART_PALETTE_ORDER_TO_LIGHTNESS.DEFAULT}\n />\n </SDot>\n )}\n <Children />\n </SDotGroup>,\n );\n}\nDot.style = style;\n\nfunction Footer(props) {\n const { styles } = props;\n const SFooter = Root;\n return sstyled(styles)(<SFooter render={Box} __excludeProps={['data', 'scale']} />);\n}\nFooter.style = style;\n\nconst Tooltip = createElement(TooltipRoot, {\n Trigger: PopperTrigger,\n Popper: PopperPopper,\n Title,\n Footer,\n Dot,\n});\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,cAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD;AAAA,MAAAS,KAAA,8BAAAV,KAAA,CAAAW,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAEnD;AACA;AACA;AACA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,KAAK;EACLyB,MAAM;EACNnB;AACF,CAAC,CAAC;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAA3G,OAAA,GAEYkD,OAAO","ignoreList":[]}
|
package/lib/cjs/Venn.js
CHANGED
|
@@ -19,17 +19,17 @@ var _Pattern = require("./Pattern");
|
|
|
19
19
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
20
20
|
var _utils = require("./utils");
|
|
21
21
|
/*!__reshadow-styles__:"./style/venn.shadow.css"*/
|
|
22
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
22
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SCircle_1gi52_gg_{fill:var(--intergalactic-chart-palette-order-2,oklch(.58 .168 278.2));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_1gi52);transition-timing-function:ease-in-out}@media (hover:hover){.___SCircle_1gi52_gg_:hover{fill-opacity:.7}}.___SCircle_1gi52_gg_.__color_1gi52_gg_{fill:var(--color_1gi52)}.___SCircle_1gi52_gg_.__pattern_1gi52_gg_.__color_1gi52_gg_{fill:var(--pattern_1gi52);fill-opacity:.7;stroke:var(--color_1gi52);stroke-width:1px}@media (hover:hover){.___SCircle_1gi52_gg_.__pattern_1gi52_gg_.__color_1gi52_gg_:hover{fill-opacity:.85}}.___SCircle_1gi52_gg_.__transparent_1gi52_gg_{opacity:.3}.___SIntersection_1gi52_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:0}@media (hover:hover){.___SIntersection_1gi52_gg_:hover{fill-opacity:.1}}.___SIntersection_1gi52_gg_.__transparent_1gi52_gg_{opacity:.3}", /*__inner_css_end__*/"1gi52_gg_"),
|
|
23
23
|
/*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SCircle": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_transparent": "
|
|
29
|
-
"__SIntersection": "
|
|
30
|
-
"--duration": "--
|
|
31
|
-
"_pattern": "
|
|
32
|
-
"--pattern": "--
|
|
25
|
+
"__SCircle": "___SCircle_1gi52_gg_",
|
|
26
|
+
"_color": "__color_1gi52_gg_",
|
|
27
|
+
"--color": "--color_1gi52",
|
|
28
|
+
"_transparent": "__transparent_1gi52_gg_",
|
|
29
|
+
"__SIntersection": "___SIntersection_1gi52_gg_",
|
|
30
|
+
"--duration": "--duration_1gi52",
|
|
31
|
+
"_pattern": "__pattern_1gi52_gg_",
|
|
32
|
+
"--pattern": "--pattern_1gi52"
|
|
33
33
|
});
|
|
34
34
|
class VennRoot extends _core.Component {
|
|
35
35
|
constructor(...args) {
|
|
@@ -14,10 +14,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
14
14
|
var _locale = require("./locale");
|
|
15
15
|
var _intergalacticDynamicLocales = require("./translations/module/__intergalactic-dynamic-locales");
|
|
16
16
|
/*!__reshadow-styles__:"../style/plotA11yModule.shadow.css"*/
|
|
17
|
-
const styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
17
|
+
const styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPlotA11yModule_5qb0j_gg_{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}", /*__inner_css_end__*/"5qb0j_gg_"),
|
|
18
18
|
/*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SPlotA11yModule": "
|
|
20
|
+
"__SPlotA11yModule": "___SPlotA11yModule_5qb0j_gg_"
|
|
21
21
|
});
|
|
22
22
|
function PlotA11yModule(props) {
|
|
23
23
|
var _ref = arguments[0],
|
|
@@ -16,10 +16,10 @@ var _intl = require("./intl");
|
|
|
16
16
|
var _summarize = require("./summarize");
|
|
17
17
|
var _intergalacticDynamicLocales = require("./translations/view/__intergalactic-dynamic-locales");
|
|
18
18
|
/*!__reshadow-styles__:"../style/plotA11yView.shadow.css"*/
|
|
19
|
-
const styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
19
|
+
const styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPlotA11yView_25i2q_gg_{position:relative;display:block;background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));border:3px solid var(--intergalactic-border-primary,#000c0829);font-size:var(--intergalactic-fs-50,10px);z-index:var(--intergalactic-z-index-overlay,500);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}@media (color-gamut:p3){.___SPlotA11yView_25i2q_gg_{border:3px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}.___SPlotA11yView_25i2q_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x,8px);display:block}.___SPlotA11yView_25i2q_gg_ :is(table,td,th){border:1px solid var(--intergalactic-border-primary,#000c0829)}@media (color-gamut:p3){.___SPlotA11yView_25i2q_gg_ :is(table,td,th){border:1px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}", /*__inner_css_end__*/"25i2q_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SPlotA11yView": "
|
|
22
|
+
"__SPlotA11yView": "___SPlotA11yView_25i2q_gg_"
|
|
23
23
|
});
|
|
24
24
|
function PlotA11yView({
|
|
25
25
|
id,
|