Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryPetukhovAkvelon committed Apr 7, 2023
1 parent 54c70a5 commit 2c9693c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/renderVisual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ export class RenderVisual {
break;
}
case LabelsAction.Rotate35: {
labels.attr('transform', function (d) {
labels.attr('transform', function () {
return 'translate(' + (<any>this).getBBox().height * -2 + ',' + (<any>this).getBBox().height + ')rotate(-35)';
}).attr('dy', '0').attr('dx', '2.5em').style('text-anchor', 'end')
.call(truncateAxis, plotSize.height * this.settings.xAxis.maximumSize / 100, {
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/legendUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {LegendPosition} from 'powerbi-visuals-utils-chartutils/lib/legend/legend
import {ColorHelper} from 'powerbi-visuals-utils-colorutils';
import {fromPixelToPoint, fromPointToPixel, measureTextWidth, TextProperties} from './textUtility';
import {getTailoredTextOrDefault} from 'powerbi-visuals-utils-formattingutils/lib/src/textMeasurementService';
import {select as d3select, selectAll as d3selectAll} from 'd3-selection';
import {select as d3select} from 'd3-selection';
import {SeriesMarkerShape} from '../seriesMarkerShape';
import {LegendIconType} from '../legendIconType';
import {IMargin} from 'powerbi-visuals-utils-svgutils';
Expand Down
12 changes: 3 additions & 9 deletions src/utilities/markersUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,31 @@ export class MarkersUtility {
public static getDataLineForForSteppedLineChart(dataLine: string): string {
let newDataLine: string = dataLine
.replace(/M/, '')
.replace(/\V/g, '!V')
.replace(/V/g, '!V')
.replace(/H/g, '!H')
.replace(/L/g, '!L');
const markedPoints: string[] = newDataLine.replace(/M/g, '!M').split('!');

newDataLine = 'M' + markedPoints[0];
const firstItem: string[] = markedPoints[0].split(',');
let currentX: number = +firstItem[0];
let currentY: number = +firstItem[1];

let j: number = 1;
while (j < markedPoints.length) {
const action: string = markedPoints[j][0];
switch (action) {
case 'H': {
const newX: number = +markedPoints[j].replace(/H/, '');
const newDelta: number = newX - currentX;
currentX = newX;
currentX = +markedPoints[j].replace(/H/, '');
newDataLine = newDataLine + markedPoints[j];
break;
}
case 'V': {
const newY: number = +markedPoints[j].replace(/\V/, '');
currentY = newY;
newDataLine = newDataLine + markedPoints[j];
break;
}
case 'M': {
const data: string[] = markedPoints[j].replace(/M/, '').split(',');
currentX = +data[0];
currentY = +data[1];
newDataLine = newDataLine + markedPoints[j];
break;
}
Expand All @@ -109,12 +103,12 @@ export class MarkersUtility {
const newX1: number = (newX + currentX) / 2;
newDataLine = newDataLine + 'H' + newX1 + 'V' + newY + 'H' + newX;
currentX = newX;
currentY = newY;
break;
}
}
j = j + 1;
}

return newDataLine;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/vizUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {valueFormatter} from 'powerbi-visuals-utils-formattingutils';

export class Formatter {
private static _instance: Formatter = new Formatter();
private _cachedFormatters: {} = {};
private _cachedFormatters: object = {};

constructor() {
if (Formatter._instance) {
Expand Down

0 comments on commit 2c9693c

Please sign in to comment.