forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(partition): add tooltip (opensearch-project#544)
This commit moves the `Datum`, `Rotation`, `Position` and `Color` into `utils/commons`. It decouples the legend from axis position and moves the `scales` to `utils/scales`. It decouples the tooltip component from the XY chart to allow Partition charts and other chart to use it. close opensearch-project#246 Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
- Loading branch information
Showing
17 changed files
with
286 additions
and
164 deletions.
There are no files selected for viewing
Binary file added
BIN
+53.2 KB
...-stories-sunburst-multiple-datums-for-tooltip-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/osd-charts/src/chart_types/partition_chart/state/selectors/is_tooltip_visible.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import createCachedSelector from 're-reselect'; | ||
import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; | ||
|
||
import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; | ||
import { TooltipType, getTooltipType } from '../../../../specs'; | ||
import { getTooltipInfoSelector } from './tooltip'; | ||
|
||
/** | ||
* The brush is available only for Ordinal xScales charts and | ||
* if we have configured an onBrushEnd listener | ||
*/ | ||
export const isTooltipVisibleSelector = createCachedSelector( | ||
[getSettingsSpecSelector, getTooltipInfoSelector], | ||
(settingsSpec, tooltipInfo): boolean => { | ||
if (getTooltipType(settingsSpec) === TooltipType.None) { | ||
return false; | ||
} | ||
return tooltipInfo.values.length > 0; | ||
}, | ||
)(getChartIdSelector); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.