annotate web/timeline/TimeAxis.coffee @ 2378:6c98a6677a7d

update js libs
author drewp@bigasterisk.com
date Sun, 12 May 2024 19:05:02 -0700
parents 4556eebe5d73
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)