UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

15 lines 983 B
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React, { memo, useMemo } from 'react'; import ChartLegend from '../../internal/components/chart-legend'; import { useSelector } from '../async-store'; export default memo(AreaChartLegend); function AreaChartLegend({ model, legendTitle, ariaLabel, plotContainerRef, }) { const legendItems = useMemo(() => model.series.map(s => { const { title, color, markerType } = model.getInternalSeries(s); return { label: title, color, type: markerType, datum: s }; }), [model]); const legendSeries = useSelector(model.interactions, state => state.legendSeries); return (React.createElement(ChartLegend, { series: legendItems, highlightedSeries: legendSeries, onHighlightChange: model.handlers.onLegendHighlight, legendTitle: legendTitle, ariaLabel: ariaLabel, plotContainerRef: plotContainerRef })); } //# sourceMappingURL=area-chart-legend.js.map