mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 00:09:51 +02:00
Added e2e test cases with some fixes
This commit is contained in:
@@ -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',
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user