Skip to content

Commit

Permalink
move the StickyEvent definition inside the plot function
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivish committed Jan 31, 2024
1 parent cd5988f commit 3687112
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ export function plot(options = {}) {
return {...state, channels: {...state.channels, ...facetState?.channels}};
};

class StickyEvent extends Event {
constructor(type, options) {
super(type, options)
this.sticky = options.sticky
}
}

// Allows e.g. the pointer transform to support viewof.
context.dispatchValue = (value, sticky) => {
if (figure.value === value && figure._sticky === sticky) return;
Expand Down Expand Up @@ -744,10 +751,3 @@ function outerRange(scale) {
if (x2 < x1) [x1, x2] = [x2, x1];
return [x1, x2 + scale.bandwidth()];
}

class StickyEvent extends Event {
constructor(type, options) {
super(type, options)
this.sticky = options.sticky
}
}

0 comments on commit 3687112

Please sign in to comment.