mdt-charts 1.21.1 → 1.21.2
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.
- package/lib/engine/features/legend/legendHelperService.js +1 -1
- package/lib/engine/features/legend/legendMarkerCreator.js +2 -2
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.d.ts +0 -1
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +0 -4
- package/lib/model/helpers/twoDimensionalModelHelper.d.ts +1 -0
- package/lib/model/helpers/twoDimensionalModelHelper.js +16 -8
- package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +2 -2
- package/lib/model/margin/twoDim/twoDimMarginModel.js +2 -2
- package/lib/model/notations/twoDimensional/styles.js +2 -2
- package/lib/style/charts-main.css +2 -2
- package/lib/style/charts-main.less +2 -2
- package/package.json +1 -1
|
@@ -25,6 +25,6 @@ export class LegendHelperService {
|
|
|
25
25
|
return "row";
|
|
26
26
|
}
|
|
27
27
|
doesLegendInTopBy2d(legendPosition, chartNotation) {
|
|
28
|
-
return legendPosition === 'top' && chartNotation === "2d";
|
|
28
|
+
return (legendPosition === 'top' || legendPosition === 'bottom') && chartNotation === "2d";
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -34,7 +34,7 @@ class SvgMarkerCreator {
|
|
|
34
34
|
renderSvg(selection) {
|
|
35
35
|
return selection.append('svg')
|
|
36
36
|
.style("display", "inline-block")
|
|
37
|
-
.style("height", '
|
|
37
|
+
.style("height", '8px')
|
|
38
38
|
.classed(Legend.markerClass, true);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -49,7 +49,7 @@ class BarMarkerCreator extends SvgMarkerCreator {
|
|
|
49
49
|
.append('rect')
|
|
50
50
|
.attr('x', 0)
|
|
51
51
|
.attr('y', 0)
|
|
52
|
-
.attr('height',
|
|
52
|
+
.attr('height', this.options.width)
|
|
53
53
|
.attr('width', this.options.width)
|
|
54
54
|
.style('fill', color);
|
|
55
55
|
if (this.options.hatch.on) {
|
|
@@ -6,6 +6,5 @@ export declare class TwoDimLegendModel {
|
|
|
6
6
|
private configReader;
|
|
7
7
|
constructor(configReader: TwoDimConfigReader);
|
|
8
8
|
recalcMarginWith2DLegend(modelInstance: ModelInstance, legendBlockModel: LegendBlockModel, legendOptions: Legend): void;
|
|
9
|
-
private getLegendSizeLegacy;
|
|
10
9
|
private getLegendModel;
|
|
11
10
|
}
|
|
@@ -23,10 +23,6 @@ export class TwoDimLegendModel {
|
|
|
23
23
|
legendBlockModel.coordinate[legendPosition].size = legendSize;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
getLegendSizeLegacy() {
|
|
27
|
-
const heightOfLegendItemWithoutWordWrapping = 20;
|
|
28
|
-
return heightOfLegendItemWithoutWordWrapping;
|
|
29
|
-
}
|
|
30
26
|
getLegendModel(legendOptions) {
|
|
31
27
|
const position = legendOptions.show ? "top" : "off";
|
|
32
28
|
return {
|
|
@@ -5,4 +5,5 @@ export declare class TwoDimensionalModelHelper {
|
|
|
5
5
|
static getGradientDefs(charts: TwoDimensionalChartModel[], keyAxisOrient: Orient, chartOrient: ChartOrientation): GradientDef[];
|
|
6
6
|
private static getGradientItems;
|
|
7
7
|
private static calculateOpacityItem;
|
|
8
|
+
private static getGradientItemColor;
|
|
8
9
|
}
|
|
@@ -37,20 +37,28 @@ export class TwoDimensionalModelHelper {
|
|
|
37
37
|
return gradients;
|
|
38
38
|
}
|
|
39
39
|
static getGradientItems(gradientId, elementColor, keyAxisOrient) {
|
|
40
|
-
return [0, 1].map(
|
|
41
|
-
id: gradientId + `-item-${
|
|
42
|
-
color: elementColor,
|
|
43
|
-
offset:
|
|
44
|
-
opacity: this.calculateOpacityItem(
|
|
40
|
+
return [0, 1].map(itemIndex => ({
|
|
41
|
+
id: gradientId + `-item-${itemIndex}`,
|
|
42
|
+
color: this.getGradientItemColor(itemIndex, keyAxisOrient, elementColor),
|
|
43
|
+
offset: itemIndex,
|
|
44
|
+
opacity: this.calculateOpacityItem(itemIndex, keyAxisOrient)
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
|
-
static calculateOpacityItem(
|
|
47
|
+
static calculateOpacityItem(itemIndex, orientation) {
|
|
48
48
|
const maxOpacity = 0.3;
|
|
49
49
|
const minOpacity = 0;
|
|
50
50
|
if (orientation === 'bottom' || orientation === 'right')
|
|
51
|
-
return
|
|
51
|
+
return itemIndex === 0 ? maxOpacity : minOpacity;
|
|
52
52
|
else
|
|
53
|
-
return
|
|
53
|
+
return itemIndex === 0 ? minOpacity : maxOpacity;
|
|
54
54
|
}
|
|
55
55
|
;
|
|
56
|
+
static getGradientItemColor(itemIndex, orientation, elementColor) {
|
|
57
|
+
const maxColor = elementColor;
|
|
58
|
+
const minColor = "white";
|
|
59
|
+
if (orientation === 'bottom' || orientation === 'right')
|
|
60
|
+
return itemIndex === 0 ? maxColor : minColor;
|
|
61
|
+
else
|
|
62
|
+
return itemIndex === 0 ? minColor : maxColor;
|
|
63
|
+
}
|
|
56
64
|
}
|
|
@@ -2,8 +2,8 @@ import { DesignerConfig } from "../../../designer/designerConfig";
|
|
|
2
2
|
import { OtherCommonComponents } from "../../model";
|
|
3
3
|
import { TwoDimConfigReader } from "../../modelInstance/configReader";
|
|
4
4
|
import { ModelInstance } from "../../modelInstance/modelInstance";
|
|
5
|
-
export declare const AXIS_HORIZONTAL_LABEL_PADDING =
|
|
6
|
-
export declare const AXIS_VERTICAL_LABEL_PADDING =
|
|
5
|
+
export declare const AXIS_HORIZONTAL_LABEL_PADDING = 20;
|
|
6
|
+
export declare const AXIS_VERTICAL_LABEL_PADDING = 8;
|
|
7
7
|
export declare class TwoDimMarginModel {
|
|
8
8
|
private designerConfig;
|
|
9
9
|
private configReader;
|
|
@@ -3,8 +3,8 @@ import { TwoDimLegendModel } from "../../featuresModel/legendModel/twoDimLegendM
|
|
|
3
3
|
import { keyAxisLabelHorizontalLog, keyAxisLabelVerticalLog } from "../../featuresModel/scaleModel/scaleAxisRecalcer";
|
|
4
4
|
import { AxisType } from "../../modelBuilder";
|
|
5
5
|
import { TwoDimensionalModel } from "../../notations/twoDimensionalModel";
|
|
6
|
-
export const AXIS_HORIZONTAL_LABEL_PADDING =
|
|
7
|
-
export const AXIS_VERTICAL_LABEL_PADDING =
|
|
6
|
+
export const AXIS_HORIZONTAL_LABEL_PADDING = 20;
|
|
7
|
+
export const AXIS_VERTICAL_LABEL_PADDING = 8;
|
|
8
8
|
export class TwoDimMarginModel {
|
|
9
9
|
constructor(designerConfig, configReader) {
|
|
10
10
|
this.designerConfig = designerConfig;
|
|
@@ -42,9 +42,9 @@ export function getLegendMarkerOptions(chart) {
|
|
|
42
42
|
}
|
|
43
43
|
export function getWidthOfLegendMarkerByType(chartType) {
|
|
44
44
|
if (chartType === "bar")
|
|
45
|
-
return
|
|
45
|
+
return 8;
|
|
46
46
|
if (chartType === "line")
|
|
47
|
-
return
|
|
47
|
+
return 24;
|
|
48
48
|
if (chartType === "area")
|
|
49
49
|
return styledElementValues.defaultLegendMarkerSizes.widthPx;
|
|
50
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--chart-base-font-size:
|
|
2
|
+
--chart-base-font-size: 12px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
text-overflow: ellipsis;
|
|
81
81
|
}
|
|
82
82
|
.legend-wrapper-without-wrap .legend-item-inline:not(:last-of-type) {
|
|
83
|
-
margin-right:
|
|
83
|
+
margin-right: 16px
|
|
84
84
|
}
|
|
85
85
|
.legend-wrapper-with-wrap .legend-item-inline {
|
|
86
86
|
margin: 2px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--chart-base-font-size:
|
|
2
|
+
--chart-base-font-size: 12px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.wrapper {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
text-overflow: ellipsis;
|
|
81
81
|
}
|
|
82
82
|
.legend-wrapper-without-wrap .legend-item-inline:not(:last-of-type) {
|
|
83
|
-
margin-right:
|
|
83
|
+
margin-right: 16px
|
|
84
84
|
}
|
|
85
85
|
.legend-wrapper-with-wrap .legend-item-inline {
|
|
86
86
|
margin: 2px;
|