|
@@ -77,12 +77,23 @@ See the [live demo](https://ievgennaida.github.io/animation-timeline-control/)
|
|
|
|
|
|
## Model
|
|
## Model
|
|
|
|
|
|
|
|
+Keyframes model is used to pass keyframes and rows to be visualized.
|
|
|
|
+Component is not changing passed model and it's used only for the visual purpose. It also means that any attached metadata can be passed and it will be preserved (Use case: you can attach additional data for each keyframe).
|
|
|
|
+
|
|
Read only and defined by the interfaces:
|
|
Read only and defined by the interfaces:
|
|
|
|
|
|
- TimelineModel
|
|
- TimelineModel
|
|
- TimelineRow
|
|
- TimelineRow
|
|
- TimelineKeyframe
|
|
- TimelineKeyframe
|
|
|
|
|
|
|
|
+Example on how to add a keyframe to existing model:
|
|
|
|
+
|
|
|
|
+```JavaScript
|
|
|
|
+ const existingModel = timeline.getModel();
|
|
|
|
+ existingModel.rows[0].keyframes.append({ val: 20 });
|
|
|
|
+ timeline.setModel(existingModel);
|
|
|
|
+```
|
|
|
|
+
|
|
### Events
|
|
### Events
|
|
|
|
|
|
| Event name | description |
|
|
| Event name | description |
|
|
@@ -108,6 +119,8 @@ this.timeline.onDragStarted((args: TimelineDragEvent) => {
|
|
|
|
|
|
### Timeline units and position
|
|
### Timeline units and position
|
|
|
|
|
|
|
|
+Expected that you have a component or engine that can execute playing a timeline. Ex: SVG has events to run the animations and report current time position. This component is meant only to visualize the position.
|
|
|
|
+
|
|
Time indicator position can be changed by a method call:
|
|
Time indicator position can be changed by a method call:
|
|
|
|
|
|
```JavaScript
|
|
```JavaScript
|
|
@@ -134,6 +147,13 @@ timeline._formatUnitsText = (val)=> { return val + ' ms'; };
|
|
|
|
|
|
### Styling
|
|
### Styling
|
|
|
|
|
|
|
|
+Timeline is rendered as a canvas, so has no HTML elements for the css styling.
|
|
|
|
+Styles can be applied on a few levels:
|
|
|
|
+
|
|
|
|
+- Global control setting (See TypeScript interface TimelineStyle)
|
|
|
|
+- row styles (See TypeScript interface TimelineRowStyle)
|
|
|
|
+- keyframe styles (See TypeScript interface TimelineKeyframeStyle)
|
|
|
|
+
|
|
Styles are applied by a global settings and can be overridden by a row or keyframe style.
|
|
Styles are applied by a global settings and can be overridden by a row or keyframe style.
|
|
|
|
|
|
## Changes
|
|
## Changes
|