Skip to content

Commit

Permalink
Add frame support, so we can use this library with time-codes at any …
Browse files Browse the repository at this point in the history
…frame-rate. TODO: minor-label rendering is not accurate in the library. Some frames are repeated, but we'll leave it as is for now because we're using our own formatter in the application part
  • Loading branch information
FranCarrascosaMS committed Jun 24, 2023
1 parent f289fc9 commit 52a9f4a
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 33 deletions.
19 changes: 18 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
},
{
"type": "node",
"request": "launch",
"name": "Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--exit",
"--timeout",
"999999",
"--colors",
"--require",
"vis-dev-utils/babel-register",
"${workspaceFolder}/test"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
2 changes: 2 additions & 0 deletions docs/graph2d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ <h3 id="timelineOptions">Timeline Options</h3>
<pre class="prettyprint lang-js">{
minorLabels: {
millisecond:'SSS',
frame: 'SSS',
second: 's',
minute: 'HH:mm',
hour: 'HH:mm',
Expand All @@ -878,6 +879,7 @@ <h3 id="timelineOptions">Timeline Options</h3>
},
majorLabels: {
millisecond:'HH:mm:ss',
frame: 'HH:mm:ss,
second: 'D MMMM HH:mm',
minute: 'ddd D MMMM',
hour: 'ddd D MMMM',
Expand Down
2 changes: 2 additions & 0 deletions docs/timeline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ <h2 id="Configuration_Options">Configuration Options</h2>
<pre class="prettyprint lang-js">{
minorLabels: {
millisecond:'SSS',
frame: 'SSS',
second: 's',
minute: 'HH:mm',
hour: 'HH:mm',
Expand All @@ -651,6 +652,7 @@ <h2 id="Configuration_Options">Configuration Options</h2>
},
majorLabels: {
millisecond:'HH:mm:ss',
frame: 'HH:mm:ss',
second: 'D MMMM HH:mm',
minute: 'ddd D MMMM',
hour: 'ddd D MMMM',
Expand Down
4 changes: 4 additions & 0 deletions lib/timeline/Graph2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ function Graph2d (container, items, groups, options) {
getStep() {
return me.timeAxis.step.step;
},
getMillisecondsPerFrame() {
return me.timeAxis.step.millisecondsPerFrame;
},


toScreen: me._toScreen.bind(me),
toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
Expand Down
Loading

0 comments on commit 52a9f4a

Please sign in to comment.