This repository has been archived by the owner on Oct 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
674 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export * from './icons'; | ||
export * from './handle'; | ||
export * from './controller'; | ||
export * from './timebar-basic'; | ||
export * from './timebar-time'; | ||
export * from './timebar-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { it } from '../../utils'; | ||
import { Timebar } from '../../../../src/ui/timebar'; | ||
|
||
export const TimebarBasic = it({ width: 500, height: 150 }, (group) => { | ||
const start = new Date('2023-08-01'); | ||
const interval = 'day'; | ||
const diff = 3600 * 24 * 1000; | ||
const data = [10, 2, 3, 4, 15, 10, 5, 0, 3, 1].map((value, index) => ({ | ||
time: new Date(start.getTime() + index * diff), | ||
value, | ||
})); | ||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
type: 'chart', | ||
width: 500, | ||
height: 150, | ||
data, | ||
interval, | ||
values: [0.25, 0.75], | ||
onChange: (value) => { | ||
console.log('onChange', value); | ||
}, | ||
onReset: () => { | ||
console.log('onReset'); | ||
}, | ||
onSpeedChange: (speed) => { | ||
console.log('onSpeedChange', speed); | ||
}, | ||
onBackward: () => { | ||
console.log('onBackward'); | ||
}, | ||
onPlay: () => { | ||
console.log('onPlay'); | ||
}, | ||
onPause: () => { | ||
console.log('onPause'); | ||
}, | ||
onForward: () => { | ||
console.log('onForward'); | ||
}, | ||
onSelectionTypeChange: (type) => { | ||
console.log('onSelectionTypeChange', type); | ||
}, | ||
onChartTypeChange: (type) => { | ||
console.log('onChartTypeChange', type); | ||
}, | ||
}, | ||
}) | ||
); | ||
}); |
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,75 @@ | ||
import { it } from '../../utils'; | ||
import { Timebar } from '../../../../src/ui/timebar'; | ||
|
||
export const TimebarChart = it((group) => { | ||
const start = new Date('2023-08-01'); | ||
const interval = 'day'; | ||
const diff = 3600 * 24 * 1000; | ||
const data = [10, 2, 3, 4, 15, 10, 5, 0, 3, 1].map((value, index) => ({ | ||
time: new Date(start.getTime() + index * diff), | ||
value, | ||
})); | ||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 0, | ||
y: 0, | ||
type: 'chart', | ||
height: 100, | ||
width: 500, | ||
interval, | ||
data, | ||
values: [0.25, 0.75], | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 0, | ||
y: 110, | ||
height: 100, | ||
width: 500, | ||
data, | ||
interval, | ||
values: [0, 0.4], | ||
type: 'chart', | ||
selectionType: 'value', | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 0, | ||
y: 220, | ||
height: 100, | ||
width: 500, | ||
data, | ||
interval, | ||
values: [0.1, 0.9], | ||
type: 'chart', | ||
chartType: 'column', | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 0, | ||
y: 330, | ||
height: 100, | ||
width: 500, | ||
data, | ||
interval, | ||
values: [0, 0.6], | ||
type: 'chart', | ||
chartType: 'column', | ||
selectionType: 'value', | ||
}, | ||
}) | ||
); | ||
}); |
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,47 @@ | ||
import { it } from '../../utils'; | ||
import { Timebar } from '../../../../src/ui/timebar'; | ||
|
||
export const TimebarTime = it((group) => { | ||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 10, | ||
y: 20, | ||
type: 'time', | ||
height: 50, | ||
width: 500, | ||
values: [0.25, 0.75], | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 10, | ||
y: 90, | ||
type: 'time', | ||
height: 50, | ||
width: 500, | ||
values: [0, 0.5], | ||
selectionType: 'value', | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Timebar({ | ||
style: { | ||
x: 10, | ||
y: 160, | ||
type: 'time', | ||
height: 50, | ||
width: 500, | ||
values: [0, 0.5], | ||
selectionType: 'value', | ||
speed: 1.5, | ||
playing: true, | ||
}, | ||
}) | ||
); | ||
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.