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.
fix(annotations): provide fallback for line annotation markers (opens…
- Loading branch information
Showing
14 changed files
with
145 additions
and
66 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
Binary file added
BIN
+3.82 KB
...stories-test-cases-no-axes-annotation-bug-fix-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.
Binary file added
BIN
+3.82 KB
...tation-should-render-marker-with-annotations-with-0-degree-rotations-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.
Binary file added
BIN
+3.76 KB
...tion-should-render-marker-with-annotations-with-180-degree-rotations-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.
Binary file added
BIN
+3.69 KB
...ation-should-render-marker-with-annotations-with-90-degree-rotations-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.
Binary file added
BIN
+3.71 KB
...uld-render-marker-with-annotations-with-negative-90-degree-rotations-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.
34 changes: 0 additions & 34 deletions
34
packages/osd-charts/integration/tests/accessibility.test.ts
This file was deleted.
Oops, something went wrong.
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
83 changes: 83 additions & 0 deletions
83
packages/osd-charts/stories/test_cases/3_no_axes_annotation.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,83 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { select } from '@storybook/addon-knobs'; | ||
import React from 'react'; | ||
|
||
import { | ||
AnnotationDomainType, | ||
LineAnnotationDatum, | ||
Chart, | ||
LineAnnotation, | ||
BarSeries, | ||
ScaleType, | ||
Position, | ||
Settings, | ||
} from '../../src'; | ||
import { getChartRotationKnob } from '../utils/knobs'; | ||
|
||
function generateAnnotationData(values: any[]): LineAnnotationDatum[] { | ||
return values.map((value, index) => ({ dataValue: value, details: `detail-${index}` })); | ||
} | ||
|
||
export const Example = () => { | ||
const markerPositionHorizontal = select( | ||
'horizontal marker position', | ||
[Position.Top, Position.Left, Position.Bottom, Position.Right, 'undefined'], | ||
'undefined', | ||
); | ||
const markerPositionVertical = select( | ||
'vertical marker position', | ||
[Position.Top, Position.Left, Position.Bottom, Position.Right, 'undefined'], | ||
'undefined', | ||
); | ||
const chartRotation = getChartRotationKnob(); | ||
return ( | ||
<Chart className="story-chart"> | ||
<Settings rotation={chartRotation} /> | ||
<LineAnnotation | ||
domainType={AnnotationDomainType.XDomain} | ||
id="ann" | ||
dataValues={[{ dataValue: 'bags' }]} | ||
marker={<div style={{ background: 'red' }}>Vertical</div>} | ||
markerPosition={markerPositionVertical === 'undefined' ? undefined : markerPositionVertical} | ||
/> | ||
<LineAnnotation | ||
domainType={AnnotationDomainType.YDomain} | ||
id="ann1" | ||
dataValues={generateAnnotationData([30])} | ||
marker={<div style={{ background: 'yellow' }}>Horizontal</div>} | ||
markerPosition={markerPositionHorizontal === 'undefined' ? undefined : markerPositionHorizontal} | ||
/> | ||
<BarSeries | ||
id="bars" | ||
name="amount" | ||
xScaleType={ScaleType.Ordinal} | ||
xAccessor="x" | ||
yAccessors={['y']} | ||
data={[ | ||
{ x: 'trousers', y: 390, val: 1222 }, | ||
{ x: 'watches', y: 23, val: 1222 }, | ||
{ x: 'bags', y: 750, val: 1222 }, | ||
{ x: 'cocktail dresses', y: 854, val: 1222 }, | ||
]} | ||
/> | ||
</Chart> | ||
); | ||
}; |
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