annotate web/timeline/TimeAxis.coffee @ 2376:4556eebe5d73

topdir reorgs; let pdm have its src/ dir; separate vite area from light9/
author drewp@bigasterisk.com
date Sun, 12 May 2024 19:02:10 -0700
parents light9/web/timeline/TimeAxis.coffee@d991f7c3485a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2062
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
1 log = debug('timeline')
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
2 debug.enable('*')
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
3
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
4 Drawing = window.Drawing
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
5 ROW_COUNT = 7
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
6
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
7
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
8
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
9
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
10 @customElement("light9-timeline-time-axis")
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
11 class TimeAxis extends LitElement
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
12 @getter_properties:
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
13 viewState: { type: Object, notify: true, observer: "onViewState" }
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
14 onViewState: ->
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
15 ko.computed =>
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
16 dependOn = [@viewState.zoomSpec.t1(), @viewState.zoomSpec.t2()]
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
17 pxPerTick = 50
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
18 axis = d3.axisTop(@viewState.zoomInX).ticks(@viewState.width() / pxPerTick)
d991f7c3485a WIP rough porting of coffee to ts
drewp@bigasterisk.com
parents:
diff changeset
19 d3.select(@$.axis).call(axis)