Browse Source

Merge branch 'do-not-pan-on-bars' into 'main'

Do not pan on bars drag

See merge request chartwerk/bar-pod!7
pull/1/head
rozetko 2 years ago
parent
commit
42a8fe4adc
  1. 2
      package.json
  2. 1
      src/index.ts
  3. 4
      src/models/bar_options.ts
  4. 6
      yarn.lock

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "@chartwerk/bar-pod", "name": "@chartwerk/bar-pod",
"version": "0.6.2", "version": "0.6.3",
"description": "Chartwerk bar pod", "description": "Chartwerk bar pod",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {

1
src/index.ts

@ -65,6 +65,7 @@ export class ChartwerkBarPod extends ChartwerkPod<BarSerie, BarOptions> {
.data(d.values) .data(d.values)
.enter().append('rect') .enter().append('rect')
.style('fill', (val, i) => d.colors[i]) .style('fill', (val, i) => d.colors[i])
.style('pointer-events', this.options.contextMenu ? 'all' : 'none')
.attr('opacity', () => this.getBarOpacity(d)) .attr('opacity', () => this.getBarOpacity(d))
.attr('x', (val: number, idx: number) => { .attr('x', (val: number, idx: number) => {
return this.getBarPositionX(d.key, idx); 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); 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 linkType: soft
"@chartwerk/core@npm:latest": "@chartwerk/core@npm:latest":
version: 0.6.5 version: 0.6.9
resolution: "@chartwerk/core@npm:0.6.5" resolution: "@chartwerk/core@npm:0.6.9"
dependencies: dependencies:
d3: ^5.7.2 d3: ^5.7.2
lodash: ^4.14.149 lodash: ^4.14.149
checksum: 2757ae8be04b84c3624bd807a437d6bf3c67fef0808e3192f0a97ba819627f3b28821628cfefdfabe1951e8b7d0d45d1b9f6ade13cdc4a5bca5e539fc70850df checksum: c7649ac10ff5edd4a6e4697334e93e72329fef1bb487f61693b70a1a7b4e65137bbcf1c4d690a9e0b7c2de01a34fbd983dfde9e3f9eab44bc5e32645e808a3b6
languageName: node languageName: node
linkType: hard linkType: hard

Loading…
Cancel
Save