Added e2e test cases with some fixes

This commit is contained in:
Subhash Halder
2023-05-13 19:45:45 +05:30
parent b2a5ddcd85
commit 0f354ff974
3 changed files with 180 additions and 5 deletions

View File

@@ -297,7 +297,10 @@ export class QuadrantBuilder {
y:
xAxisPosition === 'top'
? this.config.xAxisLabelPadding + titleSpace.top
: this.config.xAxisLabelPadding + quadrantTop + quadrantHeight,
: this.config.xAxisLabelPadding +
quadrantTop +
quadrantHeight +
this.config.quadrantPadding,
fontSize: this.config.xAxisLabelFontSize,
verticalPos: drawAxisLabelInMiddle ? 'center' : 'left',
horizontalPos: 'top',
@@ -312,7 +315,10 @@ export class QuadrantBuilder {
y:
xAxisPosition === 'top'
? this.config.xAxisLabelPadding + titleSpace.top
: this.config.xAxisLabelPadding + quadrantTop + quadrantHeight,
: this.config.xAxisLabelPadding +
quadrantTop +
quadrantHeight +
this.config.quadrantPadding,
fontSize: this.config.xAxisLabelFontSize,
verticalPos: drawAxisLabelInMiddle ? 'center' : 'left',
horizontalPos: 'top',
@@ -327,7 +333,10 @@ export class QuadrantBuilder {
x:
this.config.yAxisPosition === 'left'
? this.config.yAxisLabelPadding
: this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth,
: this.config.yAxisLabelPadding +
quadrantLeft +
quadrantWidth +
this.config.quadrantPadding,
y: quadrantTop + quadrantHeight - (drawAxisLabelInMiddle ? quadrantHalfHeight / 2 : 0),
fontSize: this.config.yAxisLabelFontSize,
verticalPos: drawAxisLabelInMiddle ? 'center' : 'left',
@@ -342,7 +351,10 @@ export class QuadrantBuilder {
x:
this.config.yAxisPosition === 'left'
? this.config.yAxisLabelPadding
: this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth,
: this.config.yAxisLabelPadding +
quadrantLeft +
quadrantWidth +
this.config.quadrantPadding,
y: quadrantTop + quadrantHalfHeight - (drawAxisLabelInMiddle ? quadrantHalfHeight / 2 : 0),
fontSize: this.config.yAxisLabelFontSize,
verticalPos: drawAxisLabelInMiddle ? 'center' : 'left',

View File

@@ -16,7 +16,7 @@ import {
export const draw = (txt: string, id: string, _version: string, diagObj: Diagram) => {
function getDominantBaseLine(horizontalPos: TextHorizontalPos) {
return horizontalPos === 'top' ? 'text-before-edge' : 'middle';
return horizontalPos === 'top' ? 'hanging' : 'middle';
}
function getTextAnchor(verticalPos: TextVerticalPos) {