mdt-charts 1.9.7 → 1.9.11

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.
Files changed (150) hide show
  1. package/README.md +190 -190
  2. package/dist/index.html +363 -48
  3. package/dist/listeners.89e1e272264c0e680de8.js +278 -0
  4. package/dist/main.f8b6bc6fee33cef1116c.js +228 -0
  5. package/dist/src_engine_engine_ts.ccee2a280374e0083541.js +759 -0
  6. package/dist/vendors-node_modules_chroma-js_chroma_js-node_modules_d3-array_src_max_js-node_modules_d3-arr-c3fc24.b32acc465b8557229277.js +1869 -0
  7. package/package.json +57 -57
  8. package/dist/bundle.js +0 -2
  9. package/dist/bundle.js.LICENSE.txt +0 -56
  10. package/lib/config/config.d.ts +0 -146
  11. package/lib/config/config.js +0 -1
  12. package/lib/designer/designerConfig.d.ts +0 -71
  13. package/lib/designer/designerConfig.js +0 -1
  14. package/lib/engine/block/block.d.ts +0 -35
  15. package/lib/engine/block/block.js +0 -110
  16. package/lib/engine/block/blockHelper.d.ts +0 -12
  17. package/lib/engine/block/blockHelper.js +0 -19
  18. package/lib/engine/contentManager.d.ts +0 -9
  19. package/lib/engine/contentManager.js +0 -29
  20. package/lib/engine/elementHighlighter/elementHighlighter.d.ts +0 -30
  21. package/lib/engine/elementHighlighter/elementHighlighter.js +0 -197
  22. package/lib/engine/elementHighlighter/selectHighlighter.d.ts +0 -11
  23. package/lib/engine/elementHighlighter/selectHighlighter.js +0 -95
  24. package/lib/engine/engine.d.ts +0 -20
  25. package/lib/engine/engine.js +0 -64
  26. package/lib/engine/features/aggregator/aggregator.d.ts +0 -22
  27. package/lib/engine/features/aggregator/aggregator.js +0 -95
  28. package/lib/engine/features/axis/axis.d.ts +0 -12
  29. package/lib/engine/features/axis/axis.js +0 -118
  30. package/lib/engine/features/axis/axisDomHelper.d.ts +0 -7
  31. package/lib/engine/features/axis/axisDomHelper.js +0 -24
  32. package/lib/engine/features/axis/axisHelper.d.ts +0 -9
  33. package/lib/engine/features/axis/axisHelper.js +0 -53
  34. package/lib/engine/features/axis/axisLabelDomHelper.d.ts +0 -17
  35. package/lib/engine/features/axis/axisLabelDomHelper.js +0 -143
  36. package/lib/engine/features/axis/axisLabelsEventManager.d.ts +0 -6
  37. package/lib/engine/features/axis/axisLabelsEventManager.js +0 -36
  38. package/lib/engine/features/embeddedLabels/embeddedLabels.d.ts +0 -23
  39. package/lib/engine/features/embeddedLabels/embeddedLabels.js +0 -147
  40. package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +0 -8
  41. package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +0 -30
  42. package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +0 -27
  43. package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +0 -65
  44. package/lib/engine/features/gridLine/gidLineHelper.d.ts +0 -13
  45. package/lib/engine/features/gridLine/gidLineHelper.js +0 -30
  46. package/lib/engine/features/gridLine/gridLine.d.ts +0 -11
  47. package/lib/engine/features/gridLine/gridLine.js +0 -67
  48. package/lib/engine/features/legend/legend.d.ts +0 -22
  49. package/lib/engine/features/legend/legend.js +0 -109
  50. package/lib/engine/features/legend/legendDomHelper.d.ts +0 -8
  51. package/lib/engine/features/legend/legendDomHelper.js +0 -48
  52. package/lib/engine/features/legend/legendEventsManager.d.ts +0 -12
  53. package/lib/engine/features/legend/legendEventsManager.js +0 -47
  54. package/lib/engine/features/legend/legendHelper.d.ts +0 -21
  55. package/lib/engine/features/legend/legendHelper.js +0 -97
  56. package/lib/engine/features/markDots/markDot.d.ts +0 -20
  57. package/lib/engine/features/markDots/markDot.js +0 -68
  58. package/lib/engine/features/markDots/markDotsHelper.d.ts +0 -6
  59. package/lib/engine/features/markDots/markDotsHelper.js +0 -16
  60. package/lib/engine/features/recordOverflowAlert/recordOverflowAlert.d.ts +0 -14
  61. package/lib/engine/features/recordOverflowAlert/recordOverflowAlert.js +0 -97
  62. package/lib/engine/features/scale/scale.d.ts +0 -16
  63. package/lib/engine/features/scale/scale.js +0 -74
  64. package/lib/engine/features/tipBox/tipBox.d.ts +0 -11
  65. package/lib/engine/features/tipBox/tipBox.js +0 -32
  66. package/lib/engine/features/tipBox/tipBoxHelper.d.ts +0 -16
  67. package/lib/engine/features/tipBox/tipBoxHelper.js +0 -48
  68. package/lib/engine/features/title/title.d.ts +0 -9
  69. package/lib/engine/features/title/title.js +0 -35
  70. package/lib/engine/features/tolltip/tooltip.d.ts +0 -19
  71. package/lib/engine/features/tolltip/tooltip.js +0 -180
  72. package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +0 -17
  73. package/lib/engine/features/tolltip/tooltipComponentsManager.js +0 -127
  74. package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +0 -36
  75. package/lib/engine/features/tolltip/tooltipDomHelper.js +0 -114
  76. package/lib/engine/features/tolltip/tooltipHelper.d.ts +0 -16
  77. package/lib/engine/features/tolltip/tooltipHelper.js +0 -99
  78. package/lib/engine/filterManager/filterEventManager.d.ts +0 -33
  79. package/lib/engine/filterManager/filterEventManager.js +0 -127
  80. package/lib/engine/helpers/domHelper.d.ts +0 -30
  81. package/lib/engine/helpers/domHelper.js +0 -68
  82. package/lib/engine/helpers/helper.d.ts +0 -30
  83. package/lib/engine/helpers/helper.js +0 -89
  84. package/lib/engine/helpers/namesHelper.d.ts +0 -5
  85. package/lib/engine/helpers/namesHelper.js +0 -9
  86. package/lib/engine/intervalNotation/gantt.d.ts +0 -10
  87. package/lib/engine/intervalNotation/gantt.js +0 -62
  88. package/lib/engine/intervalNotation/intervalManager.d.ts +0 -7
  89. package/lib/engine/intervalNotation/intervalManager.js +0 -30
  90. package/lib/engine/polarNotation/donut/DonutHelper.d.ts +0 -15
  91. package/lib/engine/polarNotation/donut/DonutHelper.js +0 -58
  92. package/lib/engine/polarNotation/donut/donut.d.ts +0 -32
  93. package/lib/engine/polarNotation/donut/donut.js +0 -124
  94. package/lib/engine/polarNotation/polarManager.d.ts +0 -10
  95. package/lib/engine/polarNotation/polarManager.js +0 -55
  96. package/lib/engine/transitionManager.d.ts +0 -19
  97. package/lib/engine/transitionManager.js +0 -64
  98. package/lib/engine/twoDimensionalNotation/area/area.d.ts +0 -17
  99. package/lib/engine/twoDimensionalNotation/area/area.js +0 -131
  100. package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +0 -9
  101. package/lib/engine/twoDimensionalNotation/area/areaHelper.js +0 -40
  102. package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +0 -34
  103. package/lib/engine/twoDimensionalNotation/bar/bar.js +0 -216
  104. package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +0 -24
  105. package/lib/engine/twoDimensionalNotation/bar/barHelper.js +0 -103
  106. package/lib/engine/twoDimensionalNotation/line/line.d.ts +0 -17
  107. package/lib/engine/twoDimensionalNotation/line/line.js +0 -132
  108. package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +0 -8
  109. package/lib/engine/twoDimensionalNotation/line/lineHelper.js +0 -28
  110. package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +0 -11
  111. package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +0 -101
  112. package/lib/engine/valueFormatter.d.ts +0 -6
  113. package/lib/engine/valueFormatter.js +0 -8
  114. package/lib/main.d.ts +0 -79
  115. package/lib/main.js +0 -85
  116. package/lib/model/chartStyleModel.d.ts +0 -16
  117. package/lib/model/chartStyleModel.js +0 -67
  118. package/lib/model/dataManagerModel.d.ts +0 -22
  119. package/lib/model/dataManagerModel.js +0 -137
  120. package/lib/model/featuresModel/axisModel.d.ts +0 -18
  121. package/lib/model/featuresModel/axisModel.js +0 -111
  122. package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +0 -7
  123. package/lib/model/featuresModel/legendModel/legendCanvasModel.js +0 -86
  124. package/lib/model/featuresModel/legendModel/legendModel.d.ts +0 -13
  125. package/lib/model/featuresModel/legendModel/legendModel.js +0 -78
  126. package/lib/model/featuresModel/otherComponents.d.ts +0 -6
  127. package/lib/model/featuresModel/otherComponents.js +0 -12
  128. package/lib/model/featuresModel/scaleModel.d.ts +0 -17
  129. package/lib/model/featuresModel/scaleModel.js +0 -100
  130. package/lib/model/featuresModel/titleModel.d.ts +0 -4
  131. package/lib/model/featuresModel/titleModel.js +0 -14
  132. package/lib/model/featuresModel/tooltipModel.d.ts +0 -4
  133. package/lib/model/featuresModel/tooltipModel.js +0 -7
  134. package/lib/model/marginModel.d.ts +0 -19
  135. package/lib/model/marginModel.js +0 -126
  136. package/lib/model/model.d.ts +0 -220
  137. package/lib/model/model.js +0 -1
  138. package/lib/model/modelBuilder.d.ts +0 -16
  139. package/lib/model/modelBuilder.js +0 -128
  140. package/lib/model/modelHelper.d.ts +0 -7
  141. package/lib/model/modelHelper.js +0 -41
  142. package/lib/model/notations/intervalModel.d.ts +0 -8
  143. package/lib/model/notations/intervalModel.js +0 -93
  144. package/lib/model/notations/polarModel.d.ts +0 -7
  145. package/lib/model/notations/polarModel.js +0 -27
  146. package/lib/model/notations/twoDimensionalModel.d.ts +0 -19
  147. package/lib/model/notations/twoDimensionalModel.js +0 -85
  148. package/lib/style/charts-main.css +0 -240
  149. package/lib/style/charts-main.less +0 -240
  150. package/test.html +0 -196
@@ -1,56 +0,0 @@
1
- /**
2
- * chroma.js - JavaScript library for color conversions
3
- *
4
- * Copyright (c) 2011-2019, Gregor Aisch
5
- * All rights reserved.
6
- *
7
- * Redistribution and use in source and binary forms, with or without
8
- * modification, are permitted provided that the following conditions are met:
9
- *
10
- * 1. Redistributions of source code must retain the above copyright notice, this
11
- * list of conditions and the following disclaimer.
12
- *
13
- * 2. Redistributions in binary form must reproduce the above copyright notice,
14
- * this list of conditions and the following disclaimer in the documentation
15
- * and/or other materials provided with the distribution.
16
- *
17
- * 3. The name Gregor Aisch may not be used to endorse or promote products
18
- * derived from this software without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- * -------------------------------------------------------
32
- *
33
- * chroma.js includes colors from colorbrewer2.org, which are released under
34
- * the following license:
35
- *
36
- * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
37
- * and The Pennsylvania State University.
38
- *
39
- * Licensed under the Apache License, Version 2.0 (the "License");
40
- * you may not use this file except in compliance with the License.
41
- * You may obtain a copy of the License at
42
- * http://www.apache.org/licenses/LICENSE-2.0
43
- *
44
- * Unless required by applicable law or agreed to in writing,
45
- * software distributed under the License is distributed on an
46
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
47
- * either express or implied. See the License for the specific
48
- * language governing permissions and limitations under the License.
49
- *
50
- * ------------------------------------------------------
51
- *
52
- * Named colors are taken from X11 Color Names.
53
- * http://www.w3.org/TR/css3-color/#svg-color
54
- *
55
- * @preserve
56
- */
@@ -1,146 +0,0 @@
1
- declare type DataType = string;
2
- export declare type AxisPosition = 'start' | 'end';
3
- export declare type ChartOrientation = 'vertical' | 'horizontal';
4
- export declare type ChartNotation = '2d' | 'polar' | 'interval';
5
- export declare type ChartType = 'bar' | 'line' | 'area' | 'donut' | 'gantt';
6
- export declare type TwoDimensionalChartType = 'line' | 'bar' | 'area';
7
- export declare type PolarChartType = 'donut';
8
- export declare type IntervalChartType = 'gantt';
9
- export declare type EmbeddedLabelType = 'none' | 'key' | 'value';
10
- export declare type TooltipHtml = (dataRow: MdtChartsDataRow) => string;
11
- export declare type MdtChartsDataRow = {
12
- [field: string]: any;
13
- };
14
- export interface MdtChartsDataSource {
15
- [source: string]: MdtChartsDataRow[];
16
- }
17
- export interface MdtChartsConfig {
18
- canvas: ChartBlockCanvas;
19
- options: PolarOptions | TwoDimensionalOptions | IntervalOptions;
20
- }
21
- export interface ChartBlockCanvas {
22
- size: Size;
23
- class: string;
24
- }
25
- export interface Size {
26
- width: number;
27
- height: number;
28
- }
29
- export interface NewSize {
30
- width?: number;
31
- height?: number;
32
- }
33
- interface Options {
34
- legend: Legend;
35
- data: DataOptions;
36
- title: string;
37
- selectable: boolean;
38
- tooltip?: TooltipOptions;
39
- }
40
- export interface TwoDimensionalOptions extends Options {
41
- type: '2d';
42
- axis: TwoDimensionalAxis;
43
- additionalElements: AdditionalElements;
44
- charts: TwoDimensionalChart[];
45
- orientation: ChartOrientation;
46
- }
47
- export interface PolarOptions extends Options {
48
- type: 'polar';
49
- chart: PolarChart;
50
- }
51
- export interface IntervalOptions extends Options {
52
- type: 'interval';
53
- axis: IntervalAxis;
54
- chart: IntervalChart;
55
- additionalElements: AdditionalElements;
56
- orientation: ChartOrientation;
57
- }
58
- export interface Legend {
59
- show: boolean;
60
- }
61
- export interface DataOptions {
62
- dataSource: string;
63
- keyField: MdtChartsField;
64
- }
65
- export interface MdtChartsField {
66
- name: string;
67
- format: DataType;
68
- }
69
- export interface ValueField extends MdtChartsField {
70
- title: string;
71
- }
72
- export interface TooltipOptions {
73
- html: TooltipHtml;
74
- }
75
- export interface AdditionalElements {
76
- gridLine: GridLineOptions;
77
- }
78
- interface GridLineOptions {
79
- flag: GridLineFlag;
80
- }
81
- interface GridLineFlag {
82
- key: boolean;
83
- value: boolean;
84
- }
85
- export interface TwoDimensionalAxis {
86
- key: DiscreteAxisOptions;
87
- value: NumberAxisOptions;
88
- }
89
- export interface AxisOptions {
90
- visibility: boolean;
91
- position: AxisPosition;
92
- ticks: AxisTicks;
93
- }
94
- interface AxisTicks {
95
- flag: boolean;
96
- }
97
- export interface NumberAxisOptions extends AxisOptions {
98
- domain: NumberDomain;
99
- }
100
- export interface NumberDomain {
101
- start: number;
102
- end: number;
103
- }
104
- export interface DiscreteAxisOptions extends AxisOptions {
105
- }
106
- export interface IntervalAxis {
107
- key: DiscreteAxisOptions;
108
- value: DateAxisOptions;
109
- }
110
- interface DateAxisOptions extends AxisOptions {
111
- }
112
- interface ChartSettings {
113
- tooltip: Tooltip;
114
- }
115
- interface Tooltip {
116
- show: boolean;
117
- }
118
- export interface TwoDimensionalChart extends ChartSettings {
119
- type: TwoDimensionalChartType;
120
- data: TwoDimensionalChartData;
121
- embeddedLabels: EmbeddedLabelType;
122
- isSegmented: boolean;
123
- markers: MarkersOptions;
124
- }
125
- export interface PolarChart extends ChartSettings {
126
- type: PolarChartType;
127
- data: PolarChartData;
128
- }
129
- export interface IntervalChart extends ChartSettings {
130
- type: IntervalChartType;
131
- data: IntervalChartData;
132
- }
133
- export interface TwoDimensionalChartData {
134
- valueFields: ValueField[];
135
- }
136
- interface MarkersOptions {
137
- show: boolean;
138
- }
139
- export interface PolarChartData {
140
- valueField: ValueField;
141
- }
142
- interface IntervalChartData {
143
- valueField1: ValueField;
144
- valueField2: ValueField;
145
- }
146
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- export declare type DataType = string;
2
- export declare type DataTypeOptions = {
3
- [option: string]: any;
4
- };
5
- export declare type Formatter = (value: any, options?: any) => string;
6
- export declare type TooltipPosition = 'followCursor' | 'fixed';
7
- export interface DesignerConfig {
8
- canvas: Canvas;
9
- dataFormat: DataFormat;
10
- chartStyle: ChartStyleConfig;
11
- elementsOptions: ElementsOptions;
12
- transitions?: Transitions;
13
- }
14
- interface Canvas {
15
- axisLabel: AxisLabelCanvas;
16
- chartBlockMargin: BlockMargin;
17
- legendBlock: LegendBlockCanvas;
18
- chartOptions: ChartOptionsCanvas;
19
- }
20
- export interface AxisLabelCanvas {
21
- maxSize: AxisLabelSize;
22
- }
23
- interface AxisLabelSize {
24
- main: number;
25
- }
26
- interface BlockMargin {
27
- top: number;
28
- bottom: number;
29
- left: number;
30
- right: number;
31
- }
32
- export interface LegendBlockCanvas {
33
- maxWidth: number;
34
- }
35
- interface ChartOptionsCanvas {
36
- bar: BarOptionsCanvas;
37
- donut: DonutOptionsCanvas;
38
- }
39
- export interface BarOptionsCanvas {
40
- minBarWidth: number;
41
- maxBarWidth: number;
42
- groupMinDistance: number;
43
- groupMaxDistance: number;
44
- barDistance: number;
45
- }
46
- export interface DonutOptionsCanvas {
47
- padAngle: number;
48
- minThickness: number;
49
- maxThickness: number;
50
- aggregatorPad: number;
51
- }
52
- interface DataFormat {
53
- formatters: Formatter;
54
- }
55
- export interface ChartStyleConfig {
56
- baseColors: string[];
57
- }
58
- export interface ElementsOptions {
59
- tooltip: TooltipSettings;
60
- }
61
- export interface TooltipSettings {
62
- position: TooltipPosition;
63
- }
64
- export interface Transitions {
65
- chartUpdate?: number;
66
- elementFadeOut?: number;
67
- tooltipSlide?: number;
68
- higlightedScale?: number;
69
- markerHover?: number;
70
- }
71
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,35 +0,0 @@
1
- import { Selection, BaseType } from "d3-selection";
2
- import { Transitions } from "../../designer/designerConfig";
3
- import { BlockMargin } from "../../model/model";
4
- import { Scales } from "../features/scale/scale";
5
- import { FilterEventManager } from "../filterManager/filterEventManager";
6
- import { TransitionManager } from "../transitionManager";
7
- import { Size } from "../../config/config";
8
- export declare class Block {
9
- parentElement: HTMLElement;
10
- id: number;
11
- transitionManager: TransitionManager;
12
- scales: Scales;
13
- filterEventManager: FilterEventManager;
14
- private svgCssClasses;
15
- private wrapperCssClasses;
16
- private parentElementSelection;
17
- private wrapper;
18
- private readonly chartBlockClass;
19
- private readonly chartGroupClass;
20
- constructor(cssClass: string, parentElement: HTMLElement, blockId: number, filterEventManager: FilterEventManager, transitions?: Transitions);
21
- renderSvg(blockSize: Size): void;
22
- renderWrapper(blockSize: Size): void;
23
- destroy(): void;
24
- getSvg(): Selection<SVGElement, unknown, HTMLElement, any>;
25
- getWrapper(): Selection<BaseType, unknown, HTMLElement, any>;
26
- renderChartsBlock(): void;
27
- getChartBlock(): Selection<SVGGElement, unknown, HTMLElement, any>;
28
- getChartGroup(chartIndex: number): Selection<SVGGElement, any, BaseType, any>;
29
- renderChartClipPath(margin: BlockMargin, blockSize: Size): void;
30
- updateChartClipPath(margin: BlockMargin, blockSize: Size): void;
31
- getClipPathId(): string;
32
- renderDefs(): Selection<SVGDefsElement, unknown, HTMLElement, unknown>;
33
- removeMouseEvents(): void;
34
- clearWrapper(): void;
35
- }
@@ -1,110 +0,0 @@
1
- import { select } from "d3-selection";
2
- import { TipBox } from "../features/tipBox/tipBox";
3
- import { Helper } from "../helpers/helper";
4
- import { NamesHelper } from "../helpers/namesHelper";
5
- import { Donut } from "../polarNotation/donut/donut";
6
- import { TransitionManager } from "../transitionManager";
7
- import { BlockHelper } from "./blockHelper";
8
- export class Block {
9
- constructor(cssClass, parentElement, blockId, filterEventManager, transitions = null) {
10
- this.chartBlockClass = 'chart-block';
11
- this.chartGroupClass = 'chart-group';
12
- this.wrapperCssClasses = Helper.getCssClassesArray(cssClass);
13
- this.svgCssClasses = Helper.getCssClassesArray(cssClass);
14
- this.wrapperCssClasses = BlockHelper.getFormattedCssClassesForWrapper(this.wrapperCssClasses);
15
- this.parentElement = parentElement;
16
- this.parentElementSelection = select(parentElement);
17
- this.id = blockId;
18
- this.transitionManager = new TransitionManager(this, transitions);
19
- this.filterEventManager = filterEventManager;
20
- }
21
- renderSvg(blockSize) {
22
- this.getWrapper()
23
- .append('svg')
24
- .attr('width', blockSize.width)
25
- .attr('height', blockSize.height)
26
- .attr('class', this.svgCssClasses.join(' ') + ' ' + NamesHelper.getClassName('svg-chart'));
27
- }
28
- renderWrapper(blockSize) {
29
- this.wrapper = this.parentElementSelection
30
- .append('div')
31
- .attr('class', this.wrapperCssClasses.join(' '))
32
- .style('width', blockSize.width + 'px')
33
- .style('height', blockSize.height + 'px')
34
- .style('position', 'relative');
35
- }
36
- destroy() {
37
- this.transitionManager.interruptTransitions();
38
- this.removeMouseEvents();
39
- this.getWrapper().remove();
40
- }
41
- getSvg() {
42
- return this.getWrapper().select(`svg.${NamesHelper.getClassName('svg-chart')}`);
43
- }
44
- getWrapper() {
45
- return this.wrapper;
46
- }
47
- renderChartsBlock() {
48
- this.getSvg()
49
- .append('g')
50
- .attr('class', this.chartBlockClass);
51
- }
52
- getChartBlock() {
53
- return this.getSvg().select(`.${this.chartBlockClass}`);
54
- }
55
- getChartGroup(chartIndex) {
56
- let group = this.getChartBlock().select(`.${this.chartGroupClass}-${chartIndex}`);
57
- if (group.empty()) {
58
- group = this.getChartBlock()
59
- .append('g')
60
- .attr('class', `${this.chartGroupClass}-${chartIndex}`);
61
- }
62
- return group;
63
- }
64
- renderChartClipPath(margin, blockSize) {
65
- const attributes = BlockHelper.getClipPathAttributes(blockSize, margin);
66
- this.renderDefs()
67
- .append('clipPath')
68
- .attr('id', this.getClipPathId())
69
- .append('rect')
70
- .attr('x', attributes.x)
71
- .attr('y', attributes.y)
72
- .attr('width', attributes.width)
73
- .attr('height', attributes.height);
74
- }
75
- updateChartClipPath(margin, blockSize) {
76
- const attributes = BlockHelper.getClipPathAttributes(blockSize, margin);
77
- this.renderDefs()
78
- .select('clipPath')
79
- .select('rect')
80
- .attr('x', attributes.x)
81
- .attr('y', attributes.y)
82
- .attr('width', attributes.width)
83
- .attr('height', attributes.height);
84
- }
85
- getClipPathId() {
86
- return NamesHelper.getId('clip-path', this.id);
87
- }
88
- renderDefs() {
89
- let defs = this.getSvg()
90
- .select('defs');
91
- if (defs.empty())
92
- defs = this.getSvg().append('defs');
93
- return defs;
94
- }
95
- removeMouseEvents() {
96
- const tipBoxes = this.getSvg().selectAll(`.${TipBox.tipBoxClass}`);
97
- tipBoxes.on('mousemove', null);
98
- tipBoxes.on('mouseover', null);
99
- tipBoxes.on('mouseleave', null);
100
- tipBoxes.on('click', null);
101
- const arcItems = Donut.getAllArcGroups(this);
102
- arcItems.on('mouseover', null);
103
- arcItems.on('mouseleave', null);
104
- arcItems.on('mousemove', null);
105
- arcItems.on('click', null);
106
- }
107
- clearWrapper() {
108
- this.getWrapper().selectAll('*').remove();
109
- }
110
- }
@@ -1,12 +0,0 @@
1
- import { BlockMargin } from "../../model/model";
2
- import { Size } from "../../config/config";
3
- export interface ClipPathAttributes {
4
- x: number;
5
- y: number;
6
- width: number;
7
- height: number;
8
- }
9
- export declare class BlockHelper {
10
- static getClipPathAttributes(blockSize: Size, margin: BlockMargin): ClipPathAttributes;
11
- static getFormattedCssClassesForWrapper(cssClasses: string[]): string[];
12
- }
@@ -1,19 +0,0 @@
1
- import { Helper } from "../helpers/helper";
2
- export class BlockHelper {
3
- static getClipPathAttributes(blockSize, margin) {
4
- const outSize = 9;
5
- return {
6
- x: margin.left - outSize,
7
- y: margin.top - outSize,
8
- width: Helper.getValueOrZero(blockSize.width - margin.left - margin.right) + outSize * 2,
9
- height: Helper.getValueOrZero(blockSize.height - margin.top - margin.bottom) + outSize * 2
10
- };
11
- }
12
- static getFormattedCssClassesForWrapper(cssClasses) {
13
- const wrapperClasses = [];
14
- cssClasses.forEach(cssClass => {
15
- wrapperClasses.push(cssClass + '-wrapper');
16
- });
17
- return wrapperClasses;
18
- }
19
- }
@@ -1,9 +0,0 @@
1
- import { Model } from "../model/model";
2
- import Engine from "./engine";
3
- import { Block } from "./block/block";
4
- import { MdtChartsDataSource } from "../config/config";
5
- export declare class ContentManager {
6
- static render(model: Model, data: MdtChartsDataSource, engine: Engine): void;
7
- static updateData(block: Block, model: Model, newData: MdtChartsDataSource): void;
8
- static updateColors(engine: Engine, model: Model): void;
9
- }
@@ -1,29 +0,0 @@
1
- import { TwoDimensionalManager } from "./twoDimensionalNotation/twoDimensionalManager";
2
- import { PolarManager } from "./polarNotation/polarManager";
3
- import { IntervalManager } from "./intervalNotation/intervalManager";
4
- export class ContentManager {
5
- static render(model, data, engine) {
6
- if (model.options.type === '2d')
7
- TwoDimensionalManager.render(engine, model);
8
- else if (model.options.type === 'polar')
9
- PolarManager.render(engine, model);
10
- else if (model.options.type === 'interval')
11
- IntervalManager.render(engine.block, model, data);
12
- }
13
- static updateData(block, model, newData) {
14
- if (model.options.type === '2d') {
15
- TwoDimensionalManager.updateData(block, model, newData);
16
- }
17
- else if (model.options.type === 'polar') {
18
- PolarManager.update(block, model, newData);
19
- }
20
- }
21
- static updateColors(engine, model) {
22
- if (model.options.type === '2d') {
23
- TwoDimensionalManager.updateColors(engine.block, model);
24
- }
25
- else if (model.options.type === 'polar') {
26
- PolarManager.updateColors(engine.block, model);
27
- }
28
- }
29
- }
@@ -1,30 +0,0 @@
1
- import { Selection, BaseType } from 'd3-selection';
2
- import { PieArcDatum } from 'd3-shape';
3
- import { BlockMargin, TwoDimensionalChartModel } from "../../model/model";
4
- import { Block } from "../block/block";
5
- import { MdtChartsDataRow, Size, TwoDimensionalChartType } from '../../config/config';
6
- export declare class ElementHighlighter {
7
- private static inactiveElemClass;
8
- static toggleActivityStyle(elementSelection: Selection<BaseType, unknown, BaseType, unknown>, isActive: boolean): void;
9
- /**
10
- * @param blurPercent процент от макс. размера блюра
11
- */
12
- static setShadowFilter(elemSelection: Selection<BaseType, any, BaseType, any>, blurPercent?: number): void;
13
- static removeFilter(elemSelection: Selection<BaseType, any, BaseType, any>): void;
14
- static removeShadowClone(block: Block, keyFieldName: string, selectedSegment: Selection<SVGGElement, PieArcDatum<MdtChartsDataRow>, BaseType, unknown>, margin: BlockMargin, blockSize: Size, donutThickness: number): void;
15
- static removeCloneForElem(block: Block, keyFieldName: string, selectedSegment: Selection<SVGGElement, PieArcDatum<MdtChartsDataRow>, BaseType, unknown>): void;
16
- static removeDonutArcClones(block: Block): void;
17
- static renderArcCloneAndHighlight(block: Block, margin: BlockMargin, arcSelection: Selection<SVGGElement, PieArcDatum<MdtChartsDataRow>, BaseType, unknown>, blockSize: Size, donutThickness: number): void;
18
- static toggleDonutHighlightState(segment: Selection<SVGGElement, PieArcDatum<MdtChartsDataRow>, BaseType, unknown>, margin: BlockMargin, blockSize: Size, donutThickness: number, transitionDuration: number, on: boolean): Promise<any>;
19
- static removeDonutHighlightingByKeys(arcSegments: Selection<SVGGElement, PieArcDatum<MdtChartsDataRow>, BaseType, unknown>, keyFieldName: string, keyValues: string[], margin: BlockMargin, blockSize: Size, donutThickness: number): void;
20
- static setInactiveFor2D(block: Block, keyFieldName: string, charts: TwoDimensionalChartModel[]): void;
21
- static toggleMarkDotVisible(markDots: Selection<BaseType, any, BaseType, any>, isHighlight: boolean): void;
22
- static remove2DChartsFullHighlighting(block: Block, charts: TwoDimensionalChartModel[], transitionDuration?: number): void;
23
- static removeUnselected2DHighlight(block: Block, keyFieldName: string, charts: TwoDimensionalChartModel[], transitionDuration: number): void;
24
- static toggle2DElements(elemSelection: Selection<BaseType, any, BaseType, any>, isHighlight: boolean, chartType: TwoDimensionalChartType, transitionDuration: number): void;
25
- private static makeArcClone;
26
- private static makeArcShadow;
27
- private static renderDonutSegmentClone;
28
- private static toggleBar;
29
- private static toggleDot;
30
- }