forked from dynatrace-oss/barista
-
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(chart): Add animation for chart heatfield.
Part of dynatrace-oss#476 Create reusable fade animation Fade in heatfield overlay Animate scale of heatfield marker and heatfield backdrop
- Loading branch information
1 parent
ff79810
commit 57a75b6
Showing
2 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Dynatrace LLC | ||
* Licensed 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 { ConnectedPosition } from '@angular/cdk/overlay'; | ||
|
||
/** Distance between heatfield backdrop and heatfield marker */ | ||
export const DT_HEATFIELD_TOP_OFFSET = 16; | ||
|
||
/** Possible heatfield overlay positions */ | ||
export const DT_HEATFIELD_OVERLAY_POSITIONS: ConnectedPosition[] = [ | ||
{ | ||
originX: 'center', | ||
originY: 'top', | ||
overlayX: 'center', | ||
overlayY: 'bottom', | ||
offsetY: -8, | ||
}, | ||
{ | ||
originX: 'end', | ||
originY: 'top', | ||
overlayX: 'start', | ||
overlayY: 'top', | ||
offsetX: 8, | ||
}, | ||
{ | ||
originX: 'start', | ||
originY: 'top', | ||
overlayX: 'end', | ||
overlayY: 'top', | ||
offsetX: -8, | ||
}, | ||
]; |
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,48 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Dynatrace LLC | ||
* Licensed 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 { | ||
animate, | ||
AnimationTriggerMetadata, | ||
state, | ||
style, | ||
transition, | ||
trigger, | ||
} from '@angular/animations'; | ||
|
||
/** | ||
* Reusable fade animation with default parameters that can be overridden | ||
* by the animation trigger property binding | ||
* Default animation: | ||
* _triggerProperty: 'void' | 'state-name' = 'void' | ||
* Override params: | ||
* _triggerProperty = { value: 'void', params: { duration: '300ms', easing: 'ease-out' }} | ||
*/ | ||
export const dtFadeAnimation: AnimationTriggerMetadata = trigger('fade', [ | ||
state('void', style({ opacity: 0 })), | ||
transition(':enter', [animate('{{ duration }} {{ easing }}')], { | ||
params: { | ||
duration: '150ms', | ||
easing: 'ease-in-out', | ||
}, | ||
}), | ||
transition(':leave', [animate('{{ duration }} {{ easing }}')], { | ||
params: { | ||
duration: '150ms', | ||
easing: 'ease-in-out', | ||
}, | ||
}), | ||
]); |