Browse Source

do not pan on bars drag

pull/1/head
rozetko 2 years ago
parent
commit
f3b20926f7
  1. 1
      src/index.ts
  2. 4
      src/models/bar_options.ts
  3. 6
      yarn.lock

1
src/index.ts

@ -65,6 +65,7 @@ export class ChartwerkBarPod extends ChartwerkPod<BarSerie, BarOptions> {
.data(d.values)
.enter().append('rect')
.style('fill', (val, i) => d.colors[i])
.style('pointer-events', this.options.contextMenu ? 'all' : 'none')
.attr('opacity', () => this.getBarOpacity(d))
.attr('x', (val: number, idx: number) => {
return this.getBarPositionX(d.key, idx);

4
src/models/bar_options.ts

@ -43,4 +43,8 @@ export class BarConfig extends CoreOptions<BarOptions> {
this._options.eventsCallbacks.contextMenu(data);
}
}
get contextMenu(): (evt: any) => void {
return this._options.eventsCallbacks.contextMenu;
}
}

6
yarn.lock

@ -20,12 +20,12 @@ __metadata:
linkType: soft
"@chartwerk/core@npm:latest":
version: 0.6.5
resolution: "@chartwerk/core@npm:0.6.5"
version: 0.6.9
resolution: "@chartwerk/core@npm:0.6.9"
dependencies:
d3: ^5.7.2
lodash: ^4.14.149
checksum: 2757ae8be04b84c3624bd807a437d6bf3c67fef0808e3192f0a97ba819627f3b28821628cfefdfabe1951e8b7d0d45d1b9f6ade13cdc4a5bca5e539fc70850df
checksum: c7649ac10ff5edd4a6e4697334e93e72329fef1bb487f61693b70a1a7b4e65137bbcf1c4d690a9e0b7c2de01a34fbd983dfde9e3f9eab44bc5e32645e808a3b6
languageName: node
linkType: hard

Loading…
Cancel
Save