higlass 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { axisLeft } from 'd3-axis';
3
+ import { format } from 'd3-format';
3
4
 
4
5
  import SVGTrack from './SVGTrack';
5
6
 
@@ -25,6 +26,17 @@ class LeftAxisTrack extends SVGTrack {
25
26
 
26
27
  draw() {
27
28
  this.axis.scale(this._yScale);
29
+
30
+ if (
31
+ this.options.reverseAxis === 'yes' ||
32
+ this.options.reverseAxis === true
33
+ ) {
34
+ const defaultFormat = format(',');
35
+ this.axis.tickFormat((d) => defaultFormat(-d));
36
+ } else {
37
+ this.axis.tickFormat(null);
38
+ }
39
+
28
40
  this.gAxis.call(this.axis);
29
41
 
30
42
  return this;
@@ -108,9 +108,10 @@ export const TRACKS_INFO = [
108
108
  orientation: '1d-vertical',
109
109
  name: 'Left Axis',
110
110
  thumbnail: svgVertical1DAxisIcon,
111
- availableOptions: ['minWidth'],
111
+ availableOptions: ['minWidth', 'reverseAxis'],
112
112
  defaultOptions: {
113
113
  minWidth: 100,
114
+ reverseAxis: false,
114
115
  },
115
116
  },
116
117
  {
@@ -521,6 +521,11 @@ export const OPTIONS_INFO = {
521
521
  inlineOptions: sizesInPx([0, 10, 20, 30, 40, 50, 100, 200, 400], 'px'),
522
522
  },
523
523
 
524
+ reverseAxis: {
525
+ name: 'Reverse Axis',
526
+ inlineOptions: YES_NO,
527
+ },
528
+
524
529
  colorbarPosition: {
525
530
  name: 'Colorbar Position',
526
531
  inlineOptions: {