@kiwibit/chart 20.0.0 → 20.0.1
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/fesm2022/kiwibit-chart.mjs +588 -0
- package/fesm2022/kiwibit-chart.mjs.map +1 -0
- package/{src/lib/models/chart.models.ts → index.d.ts} +229 -183
- package/package.json +27 -15
- package/CHANGELOG.md +0 -164
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -10
- package/src/lib/components/chart.component.ts +0 -76
- package/src/lib/constants/chart.constants.ts +0 -5
- package/src/lib/directives/kiwi-chart.directive.ts +0 -488
- package/src/public-api.ts +0 -6
- package/src/test.ts +0 -15
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
package/CHANGELOG.md
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
-
|
|
6
|
-
## [19.0.0] - 2025-01-23
|
|
7
|
-
|
|
8
|
-
### Added
|
|
9
|
-
|
|
10
|
-
- Upgrade to Angular 19.
|
|
11
|
-
|
|
12
|
-
## [18.0.0] - 2024-11-29
|
|
13
|
-
|
|
14
|
-
### Added
|
|
15
|
-
|
|
16
|
-
- Upgrade to Angular 18.
|
|
17
|
-
|
|
18
|
-
## [17.0.1] - 2024-03-22
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
|
|
22
|
-
- Created a custom Angular directive to render the chart through the echarts library.
|
|
23
|
-
|
|
24
|
-
### Changed
|
|
25
|
-
|
|
26
|
-
- Replaced chart icons in the toolbox with Material Icons svgs.
|
|
27
|
-
|
|
28
|
-
### Removed
|
|
29
|
-
|
|
30
|
-
- Removed ngx-echarts dependency.
|
|
31
|
-
|
|
32
|
-
## [17.0.0] - 2024-03-21
|
|
33
|
-
|
|
34
|
-
### Added
|
|
35
|
-
|
|
36
|
-
- Upgrade to Angular 17.
|
|
37
|
-
|
|
38
|
-
## [16.0.0] - 2024-03-05
|
|
39
|
-
|
|
40
|
-
### Added
|
|
41
|
-
|
|
42
|
-
- Upgrade to Angular 16.
|
|
43
|
-
|
|
44
|
-
## [15.0.1] - 2022-11-30
|
|
45
|
-
|
|
46
|
-
### Added
|
|
47
|
-
|
|
48
|
-
- Added initial chart configuration if not passed as an input to the chart, in order to suppress the echarts warning.
|
|
49
|
-
|
|
50
|
-
## [15.0.0] - 2022-11-30
|
|
51
|
-
|
|
52
|
-
### Added
|
|
53
|
-
|
|
54
|
-
- Upgrade to Angular 15
|
|
55
|
-
|
|
56
|
-
## [14.0.0] - 2022-11-30
|
|
57
|
-
|
|
58
|
-
### Added
|
|
59
|
-
|
|
60
|
-
- Upgrade to Angular 14
|
|
61
|
-
|
|
62
|
-
## [1.0.13] - 2022-06-29
|
|
63
|
-
|
|
64
|
-
### Added
|
|
65
|
-
|
|
66
|
-
- Added "chartHover" Output property to emit the x and y coordinates when the cursor is hovering the chart area.
|
|
67
|
-
- Added opacity property in the Trace model.
|
|
68
|
-
|
|
69
|
-
## [1.0.12] - 2022-06-14
|
|
70
|
-
|
|
71
|
-
### Added
|
|
72
|
-
|
|
73
|
-
- Added animation duration in the chart model (as optional).
|
|
74
|
-
- Added maxAxesDecimals in the chart model (as optional).
|
|
75
|
-
|
|
76
|
-
### Changed
|
|
77
|
-
|
|
78
|
-
- Changed width of the chart in the grid option (to make the legend more readable when there's less space).
|
|
79
|
-
|
|
80
|
-
## [1.0.11] - 2022-06-09
|
|
81
|
-
|
|
82
|
-
### Added
|
|
83
|
-
|
|
84
|
-
- Added min and max values (as optional) for the x and y coordinate of the chart.
|
|
85
|
-
|
|
86
|
-
### Changed
|
|
87
|
-
|
|
88
|
-
- Minor fixes in the chart legend (increased width and changed inactive color for the dark theme).
|
|
89
|
-
|
|
90
|
-
## [1.0.10] - 2022-06-08
|
|
91
|
-
|
|
92
|
-
### Added
|
|
93
|
-
|
|
94
|
-
- Re-introduced manual change detection in the chart component.
|
|
95
|
-
- Added two different "Add Point" icons for both the light and dark theme.
|
|
96
|
-
|
|
97
|
-
## [1.0.9] - 2022-05-31
|
|
98
|
-
|
|
99
|
-
### Changed
|
|
100
|
-
|
|
101
|
-
- Minor changes to the chart rendering logic.
|
|
102
|
-
|
|
103
|
-
### Removed
|
|
104
|
-
|
|
105
|
-
- Removed manual change detection in the chart component.
|
|
106
|
-
|
|
107
|
-
## [1.0.7] - 2022-05-31
|
|
108
|
-
|
|
109
|
-
### Added
|
|
110
|
-
|
|
111
|
-
- Added Dark Theme for the chart.
|
|
112
|
-
- Added documentation for the Chart's models and component.
|
|
113
|
-
|
|
114
|
-
## [1.0.4] - 2022-03-30
|
|
115
|
-
|
|
116
|
-
### Added
|
|
117
|
-
|
|
118
|
-
- Added color property for the popints in a Trace.
|
|
119
|
-
|
|
120
|
-
## [1.0.3] - 2022-03-29
|
|
121
|
-
|
|
122
|
-
### Added
|
|
123
|
-
|
|
124
|
-
- Added a property in the Chart to choose if show the grid lines or not.
|
|
125
|
-
|
|
126
|
-
### Changed
|
|
127
|
-
|
|
128
|
-
- Changed the grid lines default color to #ccc.
|
|
129
|
-
|
|
130
|
-
### Removed
|
|
131
|
-
|
|
132
|
-
- Removed the automatic add of a point in the chart when clicking on add point control button. We just pass the data to father component which then decides whether to add a point or not.
|
|
133
|
-
- Removed point name from tooltip.
|
|
134
|
-
|
|
135
|
-
## [1.0.2] - 2022-03-28
|
|
136
|
-
|
|
137
|
-
### Changed
|
|
138
|
-
|
|
139
|
-
- scrollToZoom and clickToAddPoint are now optional and by default set to false.
|
|
140
|
-
|
|
141
|
-
### Fixed
|
|
142
|
-
|
|
143
|
-
- Rounded number to 3 decimals in the point tooltip.
|
|
144
|
-
|
|
145
|
-
### Removed
|
|
146
|
-
|
|
147
|
-
- Removed restore option in the toolbox.
|
|
148
|
-
|
|
149
|
-
## [1.0.1] - 2022-03-28
|
|
150
|
-
|
|
151
|
-
### Added
|
|
152
|
-
|
|
153
|
-
- Added property in the Trace model to make a Trace not selected in the legend by default.
|
|
154
|
-
|
|
155
|
-
### Changed
|
|
156
|
-
|
|
157
|
-
- Changed Unit of Measure format in the Axes labels.
|
|
158
|
-
- Changed default symbol of a Point.
|
|
159
|
-
|
|
160
|
-
## [1.0.0] - 2022-03-25
|
|
161
|
-
|
|
162
|
-
### Added
|
|
163
|
-
|
|
164
|
-
- First release of the kiwi-chart (version 1.0.0).
|
package/karma.conf.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
jasmine: {
|
|
17
|
-
// you can add configuration options for Jasmine here
|
|
18
|
-
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
-
// for example, you can disable the random execution with `random: false`
|
|
20
|
-
// or set a specific seed with `seed: 4321`
|
|
21
|
-
},
|
|
22
|
-
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
-
},
|
|
24
|
-
jasmineHtmlReporter: {
|
|
25
|
-
suppressAll: true // removes the duplicated traces
|
|
26
|
-
},
|
|
27
|
-
coverageReporter: {
|
|
28
|
-
dir: require('path').join(__dirname, '../../../coverage/kiwibit/chart'),
|
|
29
|
-
subdir: '.',
|
|
30
|
-
reporters: [
|
|
31
|
-
{ type: 'html' },
|
|
32
|
-
{ type: 'text-summary' }
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
reporters: ['progress', 'kjhtml'],
|
|
36
|
-
port: 9876,
|
|
37
|
-
colors: true,
|
|
38
|
-
logLevel: config.LOG_INFO,
|
|
39
|
-
autoWatch: true,
|
|
40
|
-
browsers: ['Chrome'],
|
|
41
|
-
singleRun: false,
|
|
42
|
-
restartOnFileChange: true
|
|
43
|
-
});
|
|
44
|
-
};
|
package/ng-package.json
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Angular General
|
|
2
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
3
|
-
// Kiwi Chart
|
|
4
|
-
import { Chart, BasePoint } from '../models/chart.models';
|
|
5
|
-
import { KiwiChartDirective } from '../directives/kiwi-chart.directive';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'kiwi-chart',
|
|
9
|
-
template: `
|
|
10
|
-
<div
|
|
11
|
-
kiwi-chart
|
|
12
|
-
[chart]="chart"
|
|
13
|
-
[width]="width"
|
|
14
|
-
[height]="height"
|
|
15
|
-
[darkTheme]="darkTheme"
|
|
16
|
-
[darkThemeBackground]="darkThemeBackground"
|
|
17
|
-
(addPoint)="addPoint.emit($event)"
|
|
18
|
-
(chartHover)="chartHover.emit($event)"
|
|
19
|
-
></div>
|
|
20
|
-
`,
|
|
21
|
-
styles: [``],
|
|
22
|
-
imports: [KiwiChartDirective]
|
|
23
|
-
})
|
|
24
|
-
export class KiwiChartComponent {
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The Chart Object rendered by the canvas. For all the available options refer
|
|
28
|
-
* to Chart interface in the models folder.
|
|
29
|
-
*
|
|
30
|
-
* @type {(Chart | null)}
|
|
31
|
-
* @memberof KiwiChartComponent
|
|
32
|
-
*/
|
|
33
|
-
@Input({ required: true }) chart: Chart | null = null;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Width and Height of the chart area. The dimensions refer to the father component
|
|
37
|
-
* into which the kiwi-chart is inserted. For example in an empty page the width/height
|
|
38
|
-
* of the chart can take the whole available space in the page.
|
|
39
|
-
*
|
|
40
|
-
* @type {string}
|
|
41
|
-
* @memberof KiwiChartComponent
|
|
42
|
-
*/
|
|
43
|
-
@Input() width: string = '100%';
|
|
44
|
-
@Input() height: string = '480px';
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* This property simply activates or not the dark theme of the chart
|
|
48
|
-
* defined by the Echarts library. In addition the background color can be custom
|
|
49
|
-
* so that the chart can match the background of the application in which it's used.
|
|
50
|
-
*
|
|
51
|
-
* @type {boolean}
|
|
52
|
-
* @memberof KiwiChartComponent
|
|
53
|
-
*/
|
|
54
|
-
@Input() darkTheme: boolean = false;
|
|
55
|
-
@Input() darkThemeBackground: string | null = null;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Output event used to emit to the father component the coordinates
|
|
59
|
-
* of the point clicked in the chart area. This functionality to be used must
|
|
60
|
-
* have the property "clickToAddPoint" in the Chart object set to true.
|
|
61
|
-
*
|
|
62
|
-
* @type {EventEmitter<BasePoint>}
|
|
63
|
-
* @memberof KiwiChartComponent
|
|
64
|
-
*/
|
|
65
|
-
@Output() addPoint: EventEmitter<BasePoint> = new EventEmitter<BasePoint>();
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* When the cursor hovers the chart area it emits to the father component the
|
|
69
|
-
* x and y coordinates relative to the chart reference system.
|
|
70
|
-
*
|
|
71
|
-
* @type {EventEmitter<BasePoint>}
|
|
72
|
-
* @memberof KiwiChartComponent
|
|
73
|
-
*/
|
|
74
|
-
@Output() chartHover: EventEmitter<BasePoint> = new EventEmitter<BasePoint>();
|
|
75
|
-
|
|
76
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const ZOOM_IN: string = "M39.35 40.45 26.6 27.7q-1.55 1.35-3.6 2.025-2.05.675-4 .675-4.9 0-8.225-3.325Q7.45 23.75 7.45 18.9q0-4.9 3.325-8.225Q14.1 7.35 18.95 7.35q4.85 0 8.225 3.325t3.375 8.175q0 2.1-.725 4.1-.725 2-2.025 3.45l12.8 12.75ZM19 28.65q4.15 0 6.975-2.8 2.825-2.8 2.825-7 0-4.15-2.825-6.95T19 9.1q-4.2 0-7 2.8t-2.8 6.95q0 4.2 2.8 7t7 2.8Zm-.9-5.1V19.7h-3.85v-1.75h3.85v-3.8h1.75v3.8h3.8v1.75h-3.8v3.85Z";
|
|
2
|
-
export const ZOOM_OUT: string = "M41.25 39.35 29.55 27.7q-1.5 1.25-3.525 1.975Q24 30.4 22.05 30.4q-2.1 0-3.975-.725T14.9 27.65l1.2-1.2q1.2 1.1 2.65 1.65 1.45.55 3.25.55 4.2 0 7-2.8t2.8-7q0-4.15-2.8-6.95t-7-2.8q-4.15 0-7 2.8-2.85 2.8-2.75 6.95l3.2-3.4 1.3 1.3-5.35 5.35-5.3-5.35 1.3-1.3 3.05 3.3q0-4.85 3.4-8.125Q17.25 7.35 22 7.35q4.9 0 8.225 3.325Q33.55 14 33.55 18.85q0 2.1-.75 4.1-.75 2-1.95 3.45L42.5 38.05Z";
|
|
3
|
-
export const SAVE_AS_SVG: string = "M11.3 40.05q-1.35 0-2.35-1t-1-2.35V11.3q0-1.4 1-2.375 1-.975 2.35-.975h25.4q1.4 0 2.375.975.975.975.975 2.375v25.4q0 1.35-.975 2.35t-2.375 1Zm0-1.75h25.4q.6 0 1.1-.5.5-.5.5-1.1V11.3q0-.6-.5-1.1-.5-.5-1.1-.5H11.3q-.6 0-1.1.5-.5.5-.5 1.1v25.4q0 .6.5 1.1.5.5 1.1.5Zm4.1-5.15h17.65l-5.5-7.3-5.2 6.45-3.3-3.85ZM9.7 38.3V9.7v28.6Z";
|
|
4
|
-
export const RESTORE: string = "M24.2 25.65q-.65 0-1.125-.475T22.6 24q0-.7.475-1.2t1.175-.5q.65 0 1.175.525T25.95 24q0 .7-.55 1.175-.55.475-1.2.475Zm.1 14.55q-6.4 0-11.1-4.25Q8.5 31.7 8.1 25.4h1.8q.5 5.55 4.6 9.3 4.1 3.75 9.75 3.75 6.05 0 10.225-4.225T38.65 24.05q0-6.05-4.2-10.275Q30.25 9.55 24.3 9.55q-3.2 0-6.025 1.3t-4.875 3.6h4.95v1.75H10.4v-8h1.75v5.05q2.25-2.6 5.475-4.025Q20.85 7.8 24.3 7.8q3.3 0 6.225 1.25t5.125 3.475q2.2 2.225 3.475 5.175Q40.4 20.65 40.4 24q0 3.35-1.275 6.3-1.275 2.95-3.475 5.175-2.2 2.225-5.125 3.475T24.3 40.2Z";
|
|
5
|
-
export const ADD_POINT: string = "M222.895-189.538q-22.456 0-37.906-15.451-15.451-15.45-15.451-37.906v-474.21q0-22.456 15.451-37.906 15.45-15.451 38.088-15.451h322.346v28.924H223.077q-10.769 0-17.692 6.923t-6.923 17.692v473.846q0 10.769 6.923 17.692t17.692 6.923h473.846q10.77 0 17.693-6.923 6.923-6.923 6.923-17.692v-322.346h28.923v322.346q0 22.638-15.451 38.088-15.45 15.451-37.906 15.451h-474.21Zm78.028-121.539h28.923v-243.077h-28.923v243.077Zm144.923 0h28.923v-337.846h-28.923v337.846Zm144.308 0h28.923v-148.308h-28.923v148.308Zm100-327.692v-71.385h-71.385v-28.923h71.385v-71.385h28.923v71.385h71.385v28.923h-71.385v71.385h-28.923ZM460-480Z";
|