-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework LineChartPredictive to use in chart LineSeries
- Loading branch information
Showing
15 changed files
with
652 additions
and
103 deletions.
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
...s/polaris-viz/src/components/LineChartPredictive/components/PredictiveLinePoints/index.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 @@ | ||
export {PredictiveLinePoints} from './PredictiveLinePoints'; |
1 change: 0 additions & 1 deletion
1
...s/polaris-viz/src/components/LineChartPredictive/components/PredictiveLineSeries/index.ts
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...ages/polaris-viz/src/components/LineChartPredictive/components/SeriesIcon/SeriesIcon.scss
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,7 @@ | ||
.IconContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-items: center; | ||
height: 12px; | ||
width: 20px; | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/polaris-viz/src/components/LineChartPredictive/components/SeriesIcon/SeriesIcon.tsx
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,44 @@ | ||
import type {Color} from '@shopify/polaris-viz-core'; | ||
import { | ||
isGradientType, | ||
LinearGradientWithStops, | ||
changeGradientOpacity, | ||
uniqueId, | ||
} from '@shopify/polaris-viz-core'; | ||
import {useMemo} from 'react'; | ||
|
||
import styles from './SeriesIcon.scss'; | ||
|
||
export function SeriesIcon({color}: {color: Color}) { | ||
const id = useMemo(() => uniqueId('SeriesIcon'), []); | ||
|
||
return ( | ||
<div className={styles.IconContainer}> | ||
<svg | ||
width="19" | ||
height="4" | ||
viewBox="0 0 19 4" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M8 2C8 0.89543 8.89543 0 10 0C11.1046 0 12 0.89543 12 2C12 3.10457 11.1046 4 10 4C8.89543 4 8 3.10457 8 2ZM7.17071 1C7.06015 1.31278 7 1.64936 7 2C7 2.35064 7.06015 2.68722 7.17071 3H1C0.447715 3 0 2.55228 0 2C0 1.44772 0.447715 1 1 1H7.17071ZM13 2C13 2.55228 13.4477 3 14 3H14.4C14.9523 3 15.4 2.55228 15.4 2C15.4 1.44772 14.9523 1 14.4 1H14C13.4477 1 13 1.44772 13 2ZM17.6 1C17.0477 1 16.6 1.44772 16.6 2C16.6 2.55228 17.0477 3 17.6 3H18C18.5523 3 19 2.55228 19 2C19 1.44772 18.5523 1 18 1H17.6Z" | ||
fill={`url(#${id})`} | ||
/> | ||
{isGradientType(color) ? ( | ||
<defs> | ||
<LinearGradientWithStops | ||
id={id} | ||
gradient={changeGradientOpacity(color)} | ||
gradientUnits="userSpaceOnUse" | ||
y1="100%" | ||
y2="0%" | ||
/> | ||
</defs> | ||
) : null} | ||
</svg> | ||
</div> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
packages/polaris-viz/src/components/LineChartPredictive/components/SeriesIcon/index.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 @@ | ||
export {SeriesIcon} from './SeriesIcon'; |
3 changes: 2 additions & 1 deletion
3
packages/polaris-viz/src/components/LineChartPredictive/components/index.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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export {PredictiveLineSeries} from './PredictiveLineSeries'; | ||
export {PredictiveLinePoints} from './PredictiveLinePoints'; | ||
export {CustomLegend} from './CustomLegend'; | ||
export {SeriesIcon} from './SeriesIcon'; |
Oops, something went wrong.