@semcore/d3-chart 17.3.1 → 18.0.0-prerelease.1
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/es6/Hover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.js","names":["Component","sstyled","Root","canUseDOM","hasParent","trottle","React","createElement","style","_sstyled","insert","Tooltip","scaleOfBandwidth","getIndexFromData","eventToPoint","invert","scaleToBand","Hover","constructor","args","_defineProperty","xIndex","yIndex","document","e","currentTarget","eventEmitter","data","scale","x","y","rootRef","patterns","plotId","asProps","clientX","clientY","xScale","yScale","pX","pY","current","vX","vY","undefined","state","xRect","yRect","height","getBoundingClientRect","yOriginal","heightOriginal","isRootTooltip","target","setState","emit","diff","dimension","heightValue","componentDidMount","unsubscribeMouseMoveRoot","subscribe","persist","handlerMouseMoveRoot","unsubscribeMouseLeaveRoot","handlerMouseLeaveRoot","componentWillUnmount","HoverLineRoot","render","_ref3","SHoverLine","Element","styles","hideHoverLine","xRange","range","yRange","x1","y1","isHide","Fragment","cn","HoverRectRoot","_ref4","SHoverRect","xBand","yBand","step","paddingInner","HoverLineTooltip","props","_ref","arguments[0]","_ref5","SHoverLineTooltip","_assignProps","HoverLine","HoverRectTooltip","_ref2","_ref6","SHoverRectTooltip","_assignProps2","HoverRect","_______childrenComponents"],"sources":["../../src/Hover.jsx"],"sourcesContent":["import { Component, sstyled, Root } from '@semcore/core';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport style from './style/hover.shadow.css';\nimport Tooltip from './Tooltip';\nimport { scaleOfBandwidth, getIndexFromData, eventToPoint, invert, scaleToBand } from './utils';\n\nclass Hover extends Component {\n static style = style;\n\n state = {\n xIndex: null,\n yIndex: null,\n };\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n handlerMouseMoveRoot = trottle((e, currentTarget) => {\n const { eventEmitter, data, scale, x, y, rootRef, patterns, plotId } = this.asProps;\n const { clientX, clientY } = e;\n const [xScale, yScale] = scale;\n const [pX, pY] = eventToPoint(e, rootRef.current);\n const vX = invert(xScale, pX);\n const vY = invert(yScale, pY);\n const xIndex =\n x === undefined || vX === undefined ? null : getIndexFromData(data, xScale, x, vX);\n const yIndex =\n y === undefined || vY === undefined ? null : getIndexFromData(data, yScale, y, vY);\n const state = { xIndex, yIndex, patterns };\n\n const { x: xRect, y: yRect, height } = rootRef.current.getBoundingClientRect();\n const { y: yOriginal, height: heightOriginal } = currentTarget.getBoundingClientRect();\n const isRootTooltip = hasParent(e.target, rootRef.current);\n\n this.setState(state, () => {\n if (isRootTooltip) {\n eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);\n } else {\n const diff = clientY - yOriginal;\n const dimension = (diff / heightOriginal) * 100;\n const heightValue = height / 100 * dimension;\n\n eventEmitter.emit(`setTooltipPosition_${plotId}`, pX + xRect, yRect + heightValue);\n }\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, state);\n eventEmitter.emit(`setTooltipVisible_${plotId}`, xIndex !== null || yIndex !== null);\n });\n });\n\n handlerMouseLeaveRoot = trottle(() => {\n const state = {\n xIndex: null,\n yIndex: null,\n patterns: this.asProps.patterns,\n };\n this.setState(state, () => {\n this.asProps.eventEmitter.emit(`setTooltipVisible_${this.asProps.plotId}`, false);\n });\n });\n\n componentDidMount() {\n const { eventEmitter } = this.asProps;\n this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveChart', (e) => {\n e.persist();\n this.handlerMouseMoveRoot(e, e.currentTarget);\n });\n this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe(\n 'onMouseLeaveChart',\n this.handlerMouseLeaveRoot,\n );\n }\n\n componentWillUnmount() {\n if (this.unsubscribeMouseMoveRoot) {\n this.unsubscribeMouseMoveRoot();\n }\n if (this.unsubscribeMouseLeaveRoot) {\n this.unsubscribeMouseLeaveRoot();\n }\n }\n}\n\nclass HoverLineRoot extends Hover {\n static displayName = 'HoverLine';\n\n render() {\n const SHoverLine = this.Element;\n const { styles, x, y, data, scale, hideHoverLine } = this.asProps;\n const { xIndex, yIndex } = this.state;\n const [xScale, yScale] = scale;\n\n const xRange = xScale.range();\n const yRange = yScale.range();\n const x1 = xIndex !== null ? scaleOfBandwidth(xScale, data[xIndex][x]) : undefined;\n const y1 = yIndex !== null ? scaleOfBandwidth(yScale, data[yIndex][y]) : undefined;\n\n const isHide =\n typeof hideHoverLine === 'function' ? hideHoverLine(xIndex, yIndex) : hideHoverLine;\n\n if (isHide) {\n return null;\n }\n\n return sstyled(styles)(\n <>\n {xIndex !== null\n ? (\n <SHoverLine\n aria-hidden\n render='line'\n index={xIndex}\n x1={x1}\n y1={yRange[0]}\n x2={x1}\n y2={yRange[1]}\n />\n )\n : null}\n {yIndex !== null\n ? (\n <SHoverLine\n aria-hidden\n render='line'\n index={yIndex}\n x1={xRange[0]}\n y1={y1}\n x2={xRange[1]}\n y2={y1}\n />\n )\n : null}\n </>,\n );\n }\n}\n\nclass HoverRectRoot extends Hover {\n static displayName = 'HoverRect';\n\n render() {\n const SHoverRect = this.Element;\n const { styles, x, y, data, scale, hideHoverLine } = this.asProps;\n const { xIndex, yIndex } = this.state;\n const [xScale, yScale] = scale;\n\n const xRange = xScale.range();\n const yRange = yScale.range();\n const xBand = scaleToBand(xScale);\n const yBand = scaleToBand(yScale);\n\n if (hideHoverLine) {\n return null;\n }\n\n return sstyled(styles)(\n <>\n {xIndex !== null\n ? (\n <SHoverRect\n aria-hidden\n render='rect'\n index={xIndex}\n width={xBand.step() - xBand.paddingInner() / 2}\n height={yRange[0] - yRange[1]}\n x={xScale(data[xIndex][x]) - (xBand.step() * xBand.paddingInner()) / 2}\n y={yRange[1]}\n />\n )\n : null}\n {yIndex !== null\n ? (\n <SHoverRect\n aria-hidden\n render='rect'\n index={yIndex}\n width={xRange[1] - xRange[0]}\n height={yBand.step() - yBand.paddingInner() / 2}\n x={xRange[0]}\n y={yScale(data[yIndex][y]) - (yBand.step() * yBand.paddingInner()) / 2}\n />\n )\n : null}\n </>,\n );\n }\n}\n\nfunction HoverLineTooltip(props) {\n const SHoverLineTooltip = Root;\n return sstyled(props.styles)(\n <SHoverLineTooltip render={Tooltip} tag={HoverLine} excludeAnchorProps />,\n );\n}\nfunction HoverRectTooltip(props) {\n const SHoverRectTooltip = Root;\n return sstyled(props.styles)(\n <SHoverRectTooltip render={Tooltip} tag={HoverRect} excludeAnchorProps />,\n );\n}\n\nconst HoverLine = createElement(HoverLineRoot, {\n Tooltip: [HoverLineTooltip, Tooltip._______childrenComponents],\n});\nconst HoverRect = createElement(HoverRectRoot, {\n Tooltip: [HoverRectTooltip, Tooltip._______childrenComponents],\n});\n\nexport { HoverLine, HoverRect };\n"],"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACxD,OAAOC,SAAS,MAAM,mCAAmC;AACzD,SAASC,SAAS,QAAQ,mCAAmC;AAC7D,O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C,aAAA,CAACuF,iBAAiB,EAAAD,KAAA,CAAAZ,EAAA;IAAA,GAAAc,YAAA;MAAA,OAAuBC,SAAS;MAAA;IAAA,GAAAL,IAAA;EAAA,EAAsB,CAAC;AAE7E;AACA,SAASM,gBAAgBA,CAACP,KAAK,EAAE;EAAA,IAAAQ,KAAA,GAAAN,YAAA;IAAAO,KAAA;EAC/B,MAAMC,iBAAiB,GAEMzF,OAAO;EADpC,OAAAwF,KAAA,GAAOlG,OAAO,CAACyF,KAAK,CAAClB,MAAM,CAAC,eAC1BlE,KAAA,CAAAC,aAAA,CAAC6F,iBAAiB,EAAAD,KAAA,CAAAlB,EAAA;IAAA,GAAAoB,aAAA;MAAA,OAAuBC,SAAS;MAAA;IAAA,GAAAJ,KAAA;EAAA,EAAsB,CAAC;AAE7E;AAEA,MAAMF,SAAS,GAAGzF,aAAa,CAAC4D,aAAa,EAAE;EAC7CxD,OAAO,EAAE,CAAC8E,gBAAgB,EAAE9E,OAAO,CAAC4F,yBAAyB;AAC/D,CAAC,CAAC;AACF,MAAMD,SAAS,GAAG/F,aAAa,CAAC2E,aAAa,EAAE;EAC7CvE,OAAO,EAAE,CAACsF,gBAAgB,EAAEtF,OAAO,CAAC4F,yBAAyB;AAC/D,CAAC,CAAC;AAEF,SAASP,SAAS,EAAEM,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Hover.js","names":["Component","sstyled","Root","canUseDOM","hasParent","trottle","React","createElement","style","_sstyled","insert","Tooltip","scaleOfBandwidth","getIndexFromData","eventToPoint","invert","scaleToBand","TextMeasurer","STROKE_WIDTH","NOTCH_WIDTH","NOTCH_DELTA","formatValue","value","Date","toLocaleDateString","Hover","constructor","args","_defineProperty","xIndex","yIndex","document","e","currentTarget","isTickUnder","eventEmitter","data","scale","x","y","rootRef","patterns","plotId","asProps","clientX","clientY","xScale","yScale","pX","pY","current","vX","vY","undefined","state","xRect","yRect","height","getBoundingClientRect","yOriginal","heightOriginal","isRootTooltip","target","setState","diff","dimension","heightValue","emit","componentDidMount","unsubscribeMouseMoveRoot","subscribe","_","persist","handlerMouseMoveRoot","unsubscribeMouseLeaveRoot","handlerMouseLeaveRoot","componentWillUnmount","HoverLineRoot","render","_ref3","hideHoverLine","isHide","SHoverLine","Element","styles","dataHints","hideTickHover","xRange","range","yRange","x1","y1","Fragment","cn","HoveredTick","titles","getHorizontalAxesTitle","length","measurer","HoverRectRoot","_ref4","SHoverRect","xBand","yBand","xStep","step","xPaddingInner","paddingInner","yStep","yPaddingInner","HOVERED_TICK_PADDING_X","HOVERED_TICK_PADDING_Y","HOVERED_TOCK_BORDER_RADIUS","props","_ref5","paddingX","paddingY","borderRadius","tickFormatter","isFirstTick","isLastTick","textMeasurer","STickWrapper","STickHover","STick","formattedValue","width","textWidth","textHeight","measure","hoverX","tickX","hoverPos","tickPos","HoverLineTooltip","_ref","arguments[0]","_ref6","SHoverLineTooltip","_assignProps","HoverLine","HoverRectTooltip","_ref2","_ref7","SHoverRectTooltip","_assignProps2","HoverRect","_______childrenComponents"],"sources":["../../src/Hover.jsx"],"sourcesContent":["import { Component, sstyled, Root } from '@semcore/core';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport style from './style/hover.shadow.css';\nimport Tooltip from './Tooltip';\nimport { scaleOfBandwidth, getIndexFromData, eventToPoint, invert, scaleToBand } from './utils';\nimport { TextMeasurer } from './utils/TextMeasurer';\n\nconst STROKE_WIDTH = 1;\nconst NOTCH_WIDTH = 9;\nconst NOTCH_DELTA = NOTCH_WIDTH / 2 - STROKE_WIDTH / 4;\n\nfunction formatValue(value) {\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n return value;\n}\nclass Hover extends Component {\n static style = style;\n\n state = {\n xIndex: null,\n yIndex: null,\n };\n\n measurer = new TextMeasurer();\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n handlerMouseMoveRoot = trottle((e, currentTarget, isTickUnder) => {\n const { eventEmitter, data, scale, x, y, rootRef, patterns, plotId } = this.asProps;\n const { clientX, clientY } = e;\n const [xScale, yScale] = scale;\n const [pX, pY] = eventToPoint(e, rootRef.current);\n const vX = invert(xScale, pX);\n const vY = invert(yScale, pY);\n const xIndex =\n x === undefined || vX === undefined ? null : getIndexFromData(data, xScale, x, vX);\n const yIndex =\n y === undefined || vY === undefined ? null : getIndexFromData(data, yScale, y, vY);\n const state = { xIndex, yIndex, patterns };\n\n const { x: xRect, y: yRect, height } = rootRef.current.getBoundingClientRect();\n const { y: yOriginal, height: heightOriginal } = currentTarget.getBoundingClientRect();\n const isRootTooltip = hasParent(e.target, rootRef.current);\n\n this.setState(state, () => {\n let x, y;\n\n if (isRootTooltip) {\n x = clientX;\n // preserve static vertical position if it's a move on a tick.\n y = isTickUnder ? yRect + height / 2 : clientY;\n } else {\n const diff = clientY - yOriginal;\n const dimension = (diff / heightOriginal) * 100;\n const heightValue = (height / 100) * dimension;\n\n x = pX + xRect;\n // preserve static vertical position if it's a move on tick.\n y = isTickUnder ? yRect + height / 2 : yRect + heightValue;\n }\n\n eventEmitter.emit(`setTooltipPosition_${plotId}`, x, y);\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, state);\n eventEmitter.emit(`setTooltipVisible_${plotId}`, xIndex !== null || yIndex !== null);\n });\n });\n\n handlerMouseLeaveRoot = trottle(() => {\n const state = {\n xIndex: null,\n yIndex: null,\n patterns: this.asProps.patterns,\n };\n this.setState(state, () => {\n this.asProps.eventEmitter.emit(`setTooltipVisible_${this.asProps.plotId}`, false);\n });\n });\n\n componentDidMount() {\n const { eventEmitter } = this.asProps;\n this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveChart', (e, _, isTickUnder) => {\n e.persist();\n this.handlerMouseMoveRoot(e, e.currentTarget, isTickUnder);\n });\n this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe(\n 'onMouseLeaveChart',\n this.handlerMouseLeaveRoot,\n );\n }\n\n componentWillUnmount() {\n if (this.unsubscribeMouseMoveRoot) {\n this.unsubscribeMouseMoveRoot();\n }\n if (this.unsubscribeMouseLeaveRoot) {\n this.unsubscribeMouseLeaveRoot();\n }\n }\n}\n\nclass HoverLineRoot extends Hover {\n static displayName = 'HoverLine';\n\n render() {\n const { hideHoverLine } = this.asProps;\n const { xIndex, yIndex } = this.state;\n\n const isHide =\n typeof hideHoverLine === 'function' ? hideHoverLine(xIndex, yIndex) : hideHoverLine;\n\n if (isHide) {\n return null;\n }\n\n const SHoverLine = this.Element;\n const { styles, x, y, data, scale, dataHints, hideTickHover } = this.asProps;\n const [xScale, yScale] = scale;\n\n const xRange = xScale.range();\n const yRange = yScale.range();\n const x1 = xIndex !== null ? scaleOfBandwidth(xScale, data[xIndex][x]) : undefined;\n const y1 = yIndex !== null ? scaleOfBandwidth(yScale, data[yIndex][y]) : undefined;\n\n return sstyled(styles)(\n <>\n {xIndex !== null\n ? (\n <>\n <SHoverLine render='g' index={xIndex} stroke-width={STROKE_WIDTH} aria-hidden>\n <line x1={x1 - NOTCH_DELTA} x2={x1 + NOTCH_DELTA} y1={yRange[0]} y2={yRange[0]} />\n <line x1={x1} y1={yRange[0]} x2={x1} y2={yRange[1]} />\n <line x1={x1 - NOTCH_DELTA} x2={x1 + NOTCH_DELTA} y1={yRange[1]} y2={yRange[1]} />\n </SHoverLine>\n {!hideTickHover && (\n <HoveredTick\n tickFormatter={dataHints.titles.getHorizontalAxesTitle ?? formatValue}\n value={data[xIndex]?.[x]}\n isFirstTick={xIndex === 0}\n isLastTick={xIndex === data.length - 1}\n textMeasurer={this.measurer}\n styles={styles}\n x={x1}\n y={yRange[0]}\n />\n )}\n </>\n )\n : null}\n {yIndex !== null\n ? (\n <SHoverLine render='g' index={yIndex} stroke-width={STROKE_WIDTH} aria-hidden>\n <line x1={xRange[0]} y1={y1 - NOTCH_DELTA} x2={xRange[0]} y2={y1 + NOTCH_DELTA} />\n <line x1={xRange[0]} y1={y1} x2={xRange[1]} y2={y1} />\n <line x1={xRange[1]} y1={y1 - NOTCH_DELTA} x2={xRange[1]} y2={y1 + NOTCH_DELTA} />\n </SHoverLine>\n )\n : null}\n </>,\n );\n }\n}\n\nclass HoverRectRoot extends Hover {\n static displayName = 'HoverRect';\n\n render() {\n const { hideHoverLine } = this.asProps;\n\n if (hideHoverLine) {\n return null;\n }\n\n const SHoverRect = this.Element;\n const { styles, x, y, data, scale, dataHints, hideTickHover } = this.asProps;\n const { xIndex, yIndex } = this.state;\n const [xScale, yScale] = scale;\n\n const xRange = xScale.range();\n const yRange = yScale.range();\n const xBand = scaleToBand(xScale);\n const yBand = scaleToBand(yScale);\n\n const xStep = xBand.step();\n const xPaddingInner = xBand.paddingInner();\n const yStep = yBand.step();\n const yPaddingInner = yBand.paddingInner();\n\n return sstyled(styles)(\n <>\n {xIndex !== null && (\n <>\n <SHoverRect\n aria-hidden\n render='rect'\n index={xIndex}\n width={xStep - xPaddingInner / 2}\n height={yRange[0] - yRange[1]}\n x={xScale(data[xIndex][x]) - (xStep * xPaddingInner) / 2}\n y={yRange[1]}\n />\n {!hideTickHover && (\n <HoveredTick\n tickFormatter={dataHints.titles.getHorizontalAxesTitle ?? formatValue}\n value={data[xIndex]?.[x]}\n textMeasurer={this.measurer}\n styles={styles}\n x={xScale(data[xIndex][x]) + (xStep * (1 - xPaddingInner)) / 2}\n y={yRange[0]}\n />\n )}\n </>\n )}\n {yIndex !== null && (\n <SHoverRect\n aria-hidden\n render='rect'\n index={yIndex}\n width={xRange[1] - xRange[0]}\n height={yStep - yPaddingInner / 2}\n x={xRange[0]}\n y={yScale(data[yIndex][y]) - (yStep * yPaddingInner) / 2}\n />\n )}\n </>,\n );\n }\n}\n\nconst HOVERED_TICK_PADDING_X = 12;\nconst HOVERED_TICK_PADDING_Y = 4;\nconst HOVERED_TOCK_BORDER_RADIUS = 6;\n\nfunction HoveredTick(props) {\n const {\n paddingX = HOVERED_TICK_PADDING_X,\n paddingY = HOVERED_TICK_PADDING_Y,\n borderRadius = HOVERED_TOCK_BORDER_RADIUS,\n tickFormatter,\n value,\n isFirstTick = false,\n isLastTick = false,\n textMeasurer,\n styles,\n x,\n y,\n } = props;\n const STickWrapper = 'g';\n const STickHover = 'rect';\n const STick = 'text';\n\n const formattedValue = tickFormatter(value);\n\n const { width: textWidth, height: textHeight } = formattedValue !== undefined\n ? textMeasurer.measure(formattedValue)\n : { width: 0, height: 0 };\n\n const hoverX = isFirstTick\n ? x - NOTCH_DELTA\n : isLastTick\n ? x - textWidth - paddingX * 2 + NOTCH_DELTA\n : x - paddingX - textWidth / 2;\n\n const tickX = isFirstTick\n ? x + paddingX + textWidth / 2 - NOTCH_DELTA\n : isLastTick\n ? x - textWidth / 2 - paddingX + NOTCH_DELTA\n : x;\n\n const hoverPos = {\n x: hoverX,\n y: y + textHeight / 2 - paddingY / 2,\n width: textWidth + paddingX * 2,\n height: textHeight + paddingY * 2,\n };\n\n const tickPos = {\n x: tickX,\n y: y,\n };\n\n return sstyled(styles)(\n <STickWrapper>\n <STickHover\n {...hoverPos}\n rx={borderRadius}\n />\n <STick\n {...tickPos}\n >\n {formattedValue}\n </STick>\n </STickWrapper>,\n );\n}\n\nfunction HoverLineTooltip(props) {\n const SHoverLineTooltip = Root;\n return sstyled(props.styles)(\n <SHoverLineTooltip render={Tooltip} tag={HoverLine} excludeAnchorProps />,\n );\n}\nfunction HoverRectTooltip(props) {\n const SHoverRectTooltip = Root;\n return sstyled(props.styles)(\n <SHoverRectTooltip render={Tooltip} tag={HoverRect} excludeAnchorProps />,\n );\n}\n\nconst HoverLine = createElement(HoverLineRoot, {\n Tooltip: [HoverLineTooltip, Tooltip._______childrenComponents],\n});\nconst HoverRect = createElement(HoverRectRoot, {\n Tooltip: [HoverRectTooltip, Tooltip._______childrenComponents],\n});\n\nexport { HoverLine, HoverRect };\n"],"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,OAAO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,CAAC5B,KAAK,EAAE;EAAA,IAAA6B,KAAA,GAAAN,YAAA;IAAAO,KAAA;EAC/B,MAAMC,iBAAiB,GAEMrI,OAAO;EADpC,OAAAoI,KAAA,GAAO9I,OAAO,CAACgH,KAAK,CAAC7B,MAAM,CAAC,eAC1B9E,KAAA,CAAAC,aAAA,CAACyI,iBAAiB,EAAAD,KAAA,CAAAlD,EAAA;IAAA,GAAAoD,aAAA;MAAA,OAAuBC,SAAS;MAAA;IAAA,GAAAJ,KAAA;EAAA,EAAsB,CAAC;AAE7E;AAEA,MAAMF,SAAS,GAAGrI,aAAa,CAACsE,aAAa,EAAE;EAC7ClE,OAAO,EAAE,CAAC2H,gBAAgB,EAAE3H,OAAO,CAACwI,yBAAyB;AAC/D,CAAC,CAAC;AACF,MAAMD,SAAS,GAAG3I,aAAa,CAAC4F,aAAa,EAAE;EAC7CxF,OAAO,EAAE,CAACkI,gBAAgB,EAAElI,OAAO,CAACwI,yBAAyB;AAC/D,CAAC,CAAC;AAEF,SAASP,SAAS,EAAEM,SAAS","ignoreList":[]}
|
package/lib/es6/Line.js
CHANGED
|
@@ -10,17 +10,17 @@ import createElement from './createElement';
|
|
|
10
10
|
import Dots from './Dots';
|
|
11
11
|
import { resolvePatternDasharray } from './Pattern';
|
|
12
12
|
/*!__reshadow-styles__:"./style/line.shadow.css"*/
|
|
13
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
13
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLine_ty5xk_gg_{fill:#0000;stroke-width:2;stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140));transition-property:d;transition-duration:var(--duration_ty5xk);transition-timing-function:ease-in-out}.___SLine_ty5xk_gg_.__color_ty5xk_gg_{stroke:var(--color_ty5xk)}.___SLine_ty5xk_gg_.__hide_ty5xk_gg_{display:none}.___SLine_ty5xk_gg_.__transparent_ty5xk_gg_{opacity:.3}.___SNull_ty5xk_gg_{fill:#0000;stroke:var(--intergalactic-chart-palette-order-null,oklch(.9 .002 177));stroke-dasharray:4}.___SNull_ty5xk_gg_.__hide_ty5xk_gg_{display:none}.___SLineArea_ty5xk_gg_{transition-property:d;transition-duration:var(--duration_ty5xk);transition-timing-function:ease-in-out;opacity:.3;fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .01 140))}.___SLineArea_ty5xk_gg_.__color_ty5xk_gg_{fill:var(--color_ty5xk)}", /*__inner_css_end__*/"ty5xk_gg_"),
|
|
14
14
|
/*__reshadow_css_end__*/
|
|
15
15
|
{
|
|
16
|
-
"__SLine": "
|
|
17
|
-
"--duration": "--
|
|
18
|
-
"_color": "
|
|
19
|
-
"--color": "--
|
|
20
|
-
"_hide": "
|
|
21
|
-
"_transparent": "
|
|
22
|
-
"__SNull": "
|
|
23
|
-
"__SLineArea": "
|
|
16
|
+
"__SLine": "___SLine_ty5xk_gg_",
|
|
17
|
+
"--duration": "--duration_ty5xk",
|
|
18
|
+
"_color": "__color_ty5xk_gg_",
|
|
19
|
+
"--color": "--color_ty5xk",
|
|
20
|
+
"_hide": "__hide_ty5xk_gg_",
|
|
21
|
+
"_transparent": "__transparent_ty5xk_gg_",
|
|
22
|
+
"__SNull": "___SNull_ty5xk_gg_",
|
|
23
|
+
"__SLineArea": "___SLineArea_ty5xk_gg_"
|
|
24
24
|
});
|
|
25
25
|
import { definedData, definedNullData, scaleOfBandwidth, getNullData, interpolateValue, getChartDefaultColorName, eventToPoint, invert } from './utils';
|
|
26
26
|
class LineRoot extends Component {
|
package/lib/es6/Plot.js
CHANGED
|
@@ -10,10 +10,10 @@ import React from 'react';
|
|
|
10
10
|
import { makeDataHintsHandlers, makeDataHintsContainer } from './a11y/hints';
|
|
11
11
|
import { PlotA11yModule } from './a11y/PlotA11yModule';
|
|
12
12
|
/*!__reshadow-styles__:"./style/plot.shadow.css"*/
|
|
13
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
13
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SPlot_1f5de_gg_{overflow:hidden}.___SPlot_1f5de_gg_:focus{outline:none}.___SPlot_1f5de_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}foreignObject[data-aria-only]{pointer-events:none}.___SPlot_1f5de_gg_:has(foreignObject[data-aria-only]:focus-within){outline-color:var(--intergalactic-keyboard-focus-outline,#0020dd78);outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset;border-radius:var(--intergalactic-surface-rounded,8px)}@media (color-gamut:p3){.___SPlot_1f5de_gg_:has(foreignObject[data-aria-only]:focus-within){outline-color:var(--intergalactic-keyboard-focus-outline,oklch(.424 .269 264.2/.469))}}", /*__inner_css_end__*/"1f5de_gg_"),
|
|
14
14
|
/*__reshadow_css_end__*/
|
|
15
15
|
{
|
|
16
|
-
"__SPlot": "
|
|
16
|
+
"__SPlot": "___SPlot_1f5de_gg_"
|
|
17
17
|
});
|
|
18
18
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
19
19
|
import { eventToPoint, uniqueId } from './utils';
|
|
@@ -34,8 +34,9 @@ class PlotRoot extends Component {
|
|
|
34
34
|
const [pX, pY] = eventToPoint(e, this.rootRef.current);
|
|
35
35
|
const [minX, maxX] = xScale.range();
|
|
36
36
|
const [maxY, minY] = yScale.range();
|
|
37
|
-
if (pX >= minX && pX <= maxX && pY >= minY
|
|
38
|
-
|
|
37
|
+
if (pX >= minX && pX <= maxX && pY >= minY) {
|
|
38
|
+
const isTickUnder = pY >= maxY;
|
|
39
|
+
this.eventEmitter.emit('onMouseMoveChart', e, this.rootRef.current, isTickUnder);
|
|
39
40
|
} else {
|
|
40
41
|
this.eventEmitter.emit('onMouseLeaveChart', e);
|
|
41
42
|
}
|
|
@@ -71,6 +72,7 @@ class PlotRoot extends Component {
|
|
|
71
72
|
eventEmitter: this.eventEmitter,
|
|
72
73
|
rootRef: this.rootRef,
|
|
73
74
|
dataHintsHandler: this.dataHintsHandler,
|
|
75
|
+
dataHints: this.dataStructureHints,
|
|
74
76
|
resolveColor,
|
|
75
77
|
patterns,
|
|
76
78
|
duration,
|
package/lib/es6/Plot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.js","names":["Box","createComponent","Component","Root","sstyled","i18nEnhance","colorResolverEnhance","EventEmitter","React","makeDataHintsHandlers","makeDataHintsContainer","PlotA11yModule","style","_sstyled","insert","localizedMessages","eventToPoint","uniqueId","PlotRoot","constructor","props","_defineProperty","createRef","dataHints","dataStructureHints","e","scale","asProps","eventEmitter","emit","length","xScale","yScale","pX","pY","rootRef","current","minX","maxX","range","maxY","minY","setContext","data","width","height","locale","resolveColor","patterns","duration","yScaleDomain","domain","dataHintsHandler","setPointsDensity","Math","abs","$rootProps","size","plotId","render","_ref","_ref2","SPlot","styles","Children","a11yAltTextConfig","label","getI18nText","ariaLabel","createElement","cn","_assignProps","handlerMouseMove","handlerMouseLeave"],"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":["Box","createComponent","Component","Root","sstyled","i18nEnhance","colorResolverEnhance","EventEmitter","React","makeDataHintsHandlers","makeDataHintsContainer","PlotA11yModule","style","_sstyled","insert","localizedMessages","eventToPoint","uniqueId","PlotRoot","constructor","props","_defineProperty","createRef","dataHints","dataStructureHints","e","scale","asProps","eventEmitter","emit","length","xScale","yScale","pX","pY","rootRef","current","minX","maxX","range","maxY","minY","isTickUnder","setContext","data","width","height","locale","resolveColor","patterns","duration","yScaleDomain","domain","dataHintsHandler","setPointsDensity","Math","abs","$rootProps","size","plotId","render","_ref","_ref2","SPlot","styles","Children","a11yAltTextConfig","label","getI18nText","ariaLabel","createElement","cn","_assignProps","handlerMouseMove","handlerMouseLeave"],"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(PlotRoot);\n"],"mappings":";;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,oBAAoB,MAAM,sDAAsD;AACvF,OAAOC,YAAY,MAAM,sCAAsC;AAC/D,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ,cAAc;AAC5E,SAASC,cAAc,QAAQ,uBAAuB;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;AAAA;AAEvD,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,SAASC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAEhD,MAAMC,QAAQ,SAAShB,SAAS,CAAC;EAI/BiB,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,iBAWNJ,QAAQ,CAAC,CAAC;IAAAI,eAA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AQ,kBASU,OAAO;EAC3B2B,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE;AACV,CAAC,CAAC;AAAAzB,eAAA,CAZEH,QAAQ,aAcK,CAACZ,oBAAoB,CAAC,CAAC,EAAED,WAAW,CAACU,iBAAiB,CAAC,CAAC;AAyG3E,eAAed,eAAe,CAACiB,QAAQ,CAAC","ignoreList":[]}
|
package/lib/es6/Radar.js
CHANGED
|
@@ -12,27 +12,27 @@ import React, { cloneElement } from 'react';
|
|
|
12
12
|
import createElement from './createElement';
|
|
13
13
|
import { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';
|
|
14
14
|
/*!__reshadow-styles__:"./style/radar.shadow.css"*/
|
|
15
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
15
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
16
16
|
/*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SAxis": "
|
|
19
|
-
"__SAxisLine": "
|
|
20
|
-
"__SAxisTick": "
|
|
21
|
-
"_active": "
|
|
22
|
-
"__SAxisLabel": "
|
|
23
|
-
"_xDirection": "
|
|
24
|
-
"--xDirection": "--
|
|
25
|
-
"_yDirection": "
|
|
26
|
-
"--yDirection": "--
|
|
27
|
-
"__SPolygon": "
|
|
28
|
-
"_color": "
|
|
29
|
-
"--color": "--
|
|
30
|
-
"_pattern": "
|
|
31
|
-
"--pattern": "--
|
|
32
|
-
"__SPolygonDot": "
|
|
33
|
-
"_transparent": "
|
|
34
|
-
"__SPolygonLine": "
|
|
35
|
-
"__SPieRect": "
|
|
18
|
+
"__SAxis": "___SAxis_1hpm6_gg_",
|
|
19
|
+
"__SAxisLine": "___SAxisLine_1hpm6_gg_",
|
|
20
|
+
"__SAxisTick": "___SAxisTick_1hpm6_gg_",
|
|
21
|
+
"_active": "__active_1hpm6_gg_",
|
|
22
|
+
"__SAxisLabel": "___SAxisLabel_1hpm6_gg_",
|
|
23
|
+
"_xDirection": "__xDirection_1hpm6_gg_",
|
|
24
|
+
"--xDirection": "--xDirection_1hpm6",
|
|
25
|
+
"_yDirection": "__yDirection_1hpm6_gg_",
|
|
26
|
+
"--yDirection": "--yDirection_1hpm6",
|
|
27
|
+
"__SPolygon": "___SPolygon_1hpm6_gg_",
|
|
28
|
+
"_color": "__color_1hpm6_gg_",
|
|
29
|
+
"--color": "--color_1hpm6",
|
|
30
|
+
"_pattern": "__pattern_1hpm6_gg_",
|
|
31
|
+
"--pattern": "--pattern_1hpm6",
|
|
32
|
+
"__SPolygonDot": "___SPolygonDot_1hpm6_gg_",
|
|
33
|
+
"_transparent": "__transparent_1hpm6_gg_",
|
|
34
|
+
"__SPolygonLine": "___SPolygonLine_1hpm6_gg_",
|
|
35
|
+
"__SPieRect": "___SPieRect_1hpm6_gg_"
|
|
36
36
|
});
|
|
37
37
|
import Tooltip from './Tooltip';
|
|
38
38
|
import { eventToPoint, getChartDefaultColorName, measureText } from './utils';
|
package/lib/es6/RadialTree.js
CHANGED
|
@@ -10,20 +10,20 @@ import React from 'react';
|
|
|
10
10
|
import createElement from './createElement';
|
|
11
11
|
import { PatternSymbol, getPatternSymbolSize } from './Pattern';
|
|
12
12
|
/*!__reshadow-styles__:"./style/radial-tree.shadow.css"*/
|
|
13
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
13
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
14
14
|
/*__reshadow_css_end__*/
|
|
15
15
|
{
|
|
16
|
-
"__SRadian": "
|
|
17
|
-
"__SLine": "
|
|
18
|
-
"_stroke": "
|
|
19
|
-
"--stroke": "--
|
|
20
|
-
"_transparent": "
|
|
21
|
-
"__SCap": "
|
|
22
|
-
"_pattern": "
|
|
23
|
-
"__SIcon": "
|
|
24
|
-
"__SLabel": "
|
|
25
|
-
"--color": "--
|
|
26
|
-
"__SLineCap": "
|
|
16
|
+
"__SRadian": "___SRadian_ojwuj_gg_",
|
|
17
|
+
"__SLine": "___SLine_ojwuj_gg_",
|
|
18
|
+
"_stroke": "__stroke_ojwuj_gg_",
|
|
19
|
+
"--stroke": "--stroke_ojwuj",
|
|
20
|
+
"_transparent": "__transparent_ojwuj_gg_",
|
|
21
|
+
"__SCap": "___SCap_ojwuj_gg_",
|
|
22
|
+
"_pattern": "__pattern_ojwuj_gg_",
|
|
23
|
+
"__SIcon": "___SIcon_ojwuj_gg_",
|
|
24
|
+
"__SLabel": "___SLabel_ojwuj_gg_",
|
|
25
|
+
"--color": "--color_ojwuj",
|
|
26
|
+
"__SLineCap": "___SLineCap_ojwuj_gg_"
|
|
27
27
|
});
|
|
28
28
|
import { getChartDefaultColorName, measureText } from './utils';
|
|
29
29
|
const baseAngle = -Math.PI / 2; // The top vertical line
|
package/lib/es6/Reference.js
CHANGED
|
@@ -5,20 +5,20 @@ import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import createElement from './createElement';
|
|
7
7
|
/*!__reshadow-styles__:"./style/reference.shadow.css"*/
|
|
8
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
8
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
9
9
|
/*__reshadow_css_end__*/
|
|
10
10
|
{
|
|
11
|
-
"__SReferenceLine": "
|
|
12
|
-
"__STitle": "
|
|
13
|
-
"--transform-origin": "--transform-
|
|
14
|
-
"_position_top": "
|
|
15
|
-
"_position_bottom": "
|
|
16
|
-
"_position_right": "
|
|
17
|
-
"_position_left": "
|
|
18
|
-
"__SBackground": "
|
|
19
|
-
"__SStripes": "
|
|
20
|
-
"--fill": "--
|
|
21
|
-
"__SStripesPatternPath": "
|
|
11
|
+
"__SReferenceLine": "___SReferenceLine_1ycra_gg_",
|
|
12
|
+
"__STitle": "___STitle_1ycra_gg_",
|
|
13
|
+
"--transform-origin": "--transform-origin_1ycra",
|
|
14
|
+
"_position_top": "_position_top_1ycra_gg_",
|
|
15
|
+
"_position_bottom": "_position_bottom_1ycra_gg_",
|
|
16
|
+
"_position_right": "_position_right_1ycra_gg_",
|
|
17
|
+
"_position_left": "_position_left_1ycra_gg_",
|
|
18
|
+
"__SBackground": "___SBackground_1ycra_gg_",
|
|
19
|
+
"__SStripes": "___SStripes_1ycra_gg_",
|
|
20
|
+
"--fill": "--fill_1ycra",
|
|
21
|
+
"__SStripesPatternPath": "___SStripesPatternPath_1ycra_gg_"
|
|
22
22
|
});
|
|
23
23
|
import { scaleOfBandwidth } from './utils';
|
|
24
24
|
const side2direction = {
|
package/lib/es6/ScatterPlot.js
CHANGED
|
@@ -9,17 +9,17 @@ import React from 'react';
|
|
|
9
9
|
import createElement from './createElement';
|
|
10
10
|
import { PatternFill } from './Pattern';
|
|
11
11
|
/*!__reshadow-styles__:"./style/scatterplot.shadow.css"*/
|
|
12
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
12
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
13
13
|
/*__reshadow_css_end__*/
|
|
14
14
|
{
|
|
15
|
-
"__SScatterPlot": "
|
|
16
|
-
"_color": "
|
|
17
|
-
"--color": "--
|
|
18
|
-
"_pattern": "
|
|
19
|
-
"--pattern": "--
|
|
20
|
-
"_transparent": "
|
|
21
|
-
"__SValue": "
|
|
22
|
-
"--duration": "--
|
|
15
|
+
"__SScatterPlot": "___SScatterPlot_1kxs7_gg_",
|
|
16
|
+
"_color": "__color_1kxs7_gg_",
|
|
17
|
+
"--color": "--color_1kxs7",
|
|
18
|
+
"_pattern": "__pattern_1kxs7_gg_",
|
|
19
|
+
"--pattern": "--pattern_1kxs7",
|
|
20
|
+
"_transparent": "__transparent_1kxs7_gg_",
|
|
21
|
+
"__SValue": "___SValue_1kxs7_gg_",
|
|
22
|
+
"--duration": "--duration_1kxs7"
|
|
23
23
|
});
|
|
24
24
|
import Tooltip from './Tooltip';
|
|
25
25
|
import { getScatterPlotRadius } from './utils';
|
package/lib/es6/Tooltip.js
CHANGED
|
@@ -13,17 +13,20 @@ import React from 'react';
|
|
|
13
13
|
import createElement from './createElement';
|
|
14
14
|
import { PatternSymbol } from './Pattern';
|
|
15
15
|
/*!__reshadow-styles__:"./style/tooltip.shadow.css"*/
|
|
16
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
16
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__STooltip": "
|
|
20
|
-
"__STitle": "
|
|
21
|
-
"__SDotGroup": "
|
|
22
|
-
"__SDot": "
|
|
23
|
-
"__SDotCircle": "
|
|
24
|
-
"_color": "
|
|
25
|
-
"
|
|
26
|
-
"
|
|
19
|
+
"__STooltip": "___STooltip_oee7t_gg_",
|
|
20
|
+
"__STitle": "___STitle_oee7t_gg_",
|
|
21
|
+
"__SDotGroup": "___SDotGroup_oee7t_gg_",
|
|
22
|
+
"__SDot": "___SDot_oee7t_gg_",
|
|
23
|
+
"__SDotCircle": "___SDotCircle_oee7t_gg_",
|
|
24
|
+
"_color": "__color_oee7t_gg_",
|
|
25
|
+
"_lightness": "__lightness_oee7t_gg_",
|
|
26
|
+
"--color": "--color_oee7t",
|
|
27
|
+
"--lightness": "--lightness_oee7t",
|
|
28
|
+
"__SFooter": "___SFooter_oee7t_gg_",
|
|
29
|
+
"__SDotPattern": "___SDotPattern_oee7t_gg_"
|
|
27
30
|
});
|
|
28
31
|
import { getChartDefaultColorName } from './utils';
|
|
29
32
|
|
|
@@ -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 = Box;
|
|
233
240
|
const SDot = Box;
|
|
234
241
|
const SDotCircle = Box;
|
|
242
|
+
const SDotPattern = PatternSymbol;
|
|
235
243
|
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SDotGroup, _ref8.cn("SDotGroup", {
|
|
236
244
|
..._assignProps4({
|
|
237
245
|
"use:color": undefined,
|
|
238
246
|
"__excludeProps": ['data', 'scale']
|
|
239
247
|
}, _ref4)
|
|
240
|
-
}), patterns ? /*#__PURE__*/React.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/React.createElement(
|
|
248
|
+
}), patterns ? /*#__PURE__*/React.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/React.createElement(SDotPattern, _ref8.cn("SDotPattern", {
|
|
241
249
|
"color": resolveColor(color ?? defaultColor),
|
|
242
250
|
"patternKey": color ?? defaultColor
|
|
243
251
|
}))) : /*#__PURE__*/React.createElement(SDot, _ref8.cn("SDot", {}), /*#__PURE__*/React.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.createElement(Children, _ref8.cn("Children", {})));
|
|
246
255
|
}
|
|
247
256
|
Dot.style = style;
|
package/lib/es6/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":["Popper","Box","Component","Root","sstyled","findComponent","useColorResolver","React","createElement","PatternSymbol","style","_sstyled","insert","getChartDefaultColorName","TooltipDotRenderContext","createContext","index","indexKeysCache","Set","TooltipRoot","constructor","args","_defineProperty","$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","Tooltip","Trigger","displayName","renderContext","clear","patterns","Provider","value","_assignProps","handlerCancel","allowedAutoPlacements","setTrigger","Fragment","handleTriggerClick","PopperTrigger","_ref2","arguments[0]","_assignProps2","PopperPopper","props","_ref6","Element","STooltip","styles","useCallback","cn","Title","_ref3","_ref7","STitle","_assignProps3","Dot","_ref4","_ref8","color","resolveColor","useContext","defaultColor","key","has","add","SDotGroup","SDot","SDotCircle","_assignProps4","undefined","Footer","_ref5","_ref9","SFooter","_assignProps5"],"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":";;;;;;;AAAA,SAASA,MAAM,EAAEC,GAAG,QAAQ,0BAA0B;AACtD,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACxD,OAAOC,aAAa,MAAM,uCAAuC;AACjE,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC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AAA,CAAAC,aAAA,CAACwD,QAAQ,EAAAwC,KAAA,CAAAR,EAAA,gBAAE,CACF,CAAC;AAEhB;AACAM,GAAG,CAAC5F,KAAK,GAAGA,KAAK;AAEjB,SAAS2G,MAAMA,CAAC3B,KAAK,EAAE;EAAA,IAAA4B,KAAA,GAAA/B,YAAA;IAAAgC,KAAA;EACrB,MAAM;IAAEzB;EAAO,CAAC,GAAGJ,KAAK;EACxB,MAAM8B,OAAO,GAC2BvH,GAAG;EAA3C,OAAAsH,KAAA,GAAOnH,OAAO,CAAC0F,MAAM,CAAC,eAACvF,KAAA,CAAAC,aAAA,CAACgH,OAAO,EAAAD,KAAA,CAAAvB,EAAA;IAAA,GAAAyB,aAAA;MAAA,kBAA8B,CAAC,MAAM,EAAE,OAAO;IAAC,GAAAH,KAAA;EAAA,EAAG,CAAC;AACpF;AACAD,MAAM,CAAC3G,KAAK,GAAGA,KAAK;AAEpB,MAAM6D,OAAO,GAAG/D,aAAa,CAACW,WAAW,EAAE;EACzCqD,OAAO,EAAEa,aAAa;EACtBrF,MAAM,EAAEyF,YAAY;EACpBQ,KAAK;EACLoB,MAAM;EACNf;AACF,CAAC,CAAC;AAEF,eAAe/B,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["Popper","Box","Component","Root","sstyled","findComponent","useColorResolver","React","createElement","PatternSymbol","style","_sstyled","insert","getChartDefaultColorName","TooltipDotRenderContext","createContext","index","indexKeysCache","Set","TooltipRoot","constructor","args","_defineProperty","$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","Tooltip","Trigger","displayName","renderContext","clear","patterns","Provider","value","_assignProps","handlerCancel","allowedAutoPlacements","setTrigger","Fragment","handleTriggerClick","PopperTrigger","_ref2","arguments[0]","_assignProps2","PopperPopper","props","_ref6","Element","STooltip","styles","useCallback","cn","Title","_ref3","_ref7","STitle","_assignProps3","CHART_PALETTE_ORDER_TO_LIGHTNESS","Dot","_ref4","_ref8","color","resolveColor","useContext","defaultColor","key","has","add","SDotGroup","SDot","SDotCircle","SDotPattern","_assignProps4","undefined","DEFAULT","Footer","_ref5","_ref9","SFooter","_assignProps5"],"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":";;;;;;;AAAA,SAASA,MAAM,EAAEC,GAAG,QAAQ,0BAA0B;AACtD,SAASC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACxD,OAAOC,aAAa,MAAM,uCAAuC;AACjE,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,aAAa,QAAQ,WAAW;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE1C,SAASC,wBAAwB,QAAQ,SAAS;;AAElD;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,gBAAGP,KAAK,CAACQ,aAAa,CAAC;EAAEC,KAAK,EAAE,CAAC,CAAC;EAAEC,cAAc,EAAE,IAAIC,GAAG,CAAC;AAAE,CAAC,CAAC;AAE7F,MAAMC,WAAW,SAASjB,SAAS,CAAC;EAAAkB,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBAK1B;MACNC,QAAQ,EAAE,KAAK;MACfC,WAAW,EAAE,CAAC,CAAC;MACfC,YAAY,EAAE,CAAC;IACjB,CAAC;IAAAH,eAAA,wBAEe;MAAEN,KAAK,EAAE,CAAC,CAAC;MAAEC,cAAc,EAAE,IAAIC,GAAG,CAAC;IAAE,CAAC;IAAAI,eAAA,wBAExC,MAAM,KAAK;IAAAA,eAAA,iCAsBF;MAAEI,CAAC,EAAE,CAAC;MAAEC,CAAC,EAAE;IAAE,CAAC;IAAAL,eAAA,gCACf,IAAI;IAAAA,eAAA,sBACd,EA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aAAa,CAACW,WAAW,EAAE;EACzCqD,OAAO,EAAEa,aAAa;EACtBrF,MAAM,EAAEyF,YAAY;EACpBQ,KAAK;EACLuB,MAAM;EACNjB;AACF,CAAC,CAAC;AAEF,eAAehC,OAAO","ignoreList":[]}
|
package/lib/es6/Venn.js
CHANGED
|
@@ -12,17 +12,17 @@ import React from 'react';
|
|
|
12
12
|
import createElement from './createElement';
|
|
13
13
|
import { PatternFill } from './Pattern';
|
|
14
14
|
/*!__reshadow-styles__:"./style/venn.shadow.css"*/
|
|
15
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
15
|
+
const style = (/*__reshadow_css_start__*/_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_"),
|
|
16
16
|
/*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SCircle": "
|
|
19
|
-
"_color": "
|
|
20
|
-
"--color": "--
|
|
21
|
-
"_transparent": "
|
|
22
|
-
"__SIntersection": "
|
|
23
|
-
"--duration": "--
|
|
24
|
-
"_pattern": "
|
|
25
|
-
"--pattern": "--
|
|
18
|
+
"__SCircle": "___SCircle_1gi52_gg_",
|
|
19
|
+
"_color": "__color_1gi52_gg_",
|
|
20
|
+
"--color": "--color_1gi52",
|
|
21
|
+
"_transparent": "__transparent_1gi52_gg_",
|
|
22
|
+
"__SIntersection": "___SIntersection_1gi52_gg_",
|
|
23
|
+
"--duration": "--duration_1gi52",
|
|
24
|
+
"_pattern": "__pattern_1gi52_gg_",
|
|
25
|
+
"--pattern": "--pattern_1gi52"
|
|
26
26
|
});
|
|
27
27
|
import Tooltip from './Tooltip';
|
|
28
28
|
import { getChartDefaultColorName } from './utils';
|
|
@@ -7,10 +7,10 @@ import { Context as I18nContext, useI18n } from '@semcore/core/lib/utils/enhance
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { normalizeLocale } from './locale';
|
|
9
9
|
/*!__reshadow-styles__:"../style/plotA11yModule.shadow.css"*/
|
|
10
|
-
const styles = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
10
|
+
const styles = (/*__reshadow_css_start__*/_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_"),
|
|
11
11
|
/*__reshadow_css_end__*/
|
|
12
12
|
{
|
|
13
|
-
"__SPlotA11yModule": "
|
|
13
|
+
"__SPlotA11yModule": "___SPlotA11yModule_5qb0j_gg_"
|
|
14
14
|
});
|
|
15
15
|
import { localizedMessages } from './translations/module/__intergalactic-dynamic-locales';
|
|
16
16
|
export function PlotA11yModule(props) {
|