@oliasoft-open-source/charts-library 2.4.0 → 2.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"eslint-plugin-react": "^7.31.1",
|
|
68
68
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
69
69
|
"html-webpack-plugin": "^5.5.0",
|
|
70
|
+
"http-server": "^14.1.1",
|
|
70
71
|
"husky": "^8.0.1",
|
|
71
72
|
"jest": "^29.0.1",
|
|
72
73
|
"jest-transform-stub": "^2.0.0",
|
|
@@ -96,7 +97,6 @@
|
|
|
96
97
|
"chartjs-plugin-zoom": "^1.2.1",
|
|
97
98
|
"classnames": "^2.3.1",
|
|
98
99
|
"fraction.js": "^4.2.0",
|
|
99
|
-
"http-server": "^14.1.1",
|
|
100
100
|
"less-vars-to-js": "^1.3.0",
|
|
101
101
|
"prop-types": "^15.8.1",
|
|
102
102
|
"react-base64-downloader": "^2.1.7",
|
package/release-notes.md
CHANGED
|
@@ -383,14 +383,10 @@ const LineChart = (props) => {
|
|
|
383
383
|
return (
|
|
384
384
|
<div
|
|
385
385
|
className={getClassName(chartStyling, styles)}
|
|
386
|
-
style={
|
|
387
|
-
chartStyling.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
width: chartStyling.width || AUTO,
|
|
391
|
-
height: chartStyling.height || AUTO,
|
|
392
|
-
}
|
|
393
|
-
}
|
|
386
|
+
style={{
|
|
387
|
+
width: chartStyling.width || AUTO,
|
|
388
|
+
height: chartStyling.height || AUTO,
|
|
389
|
+
}}
|
|
394
390
|
tabIndex={0} //eslint-disable-line jsx-a11y/no-noninteractive-tabindex
|
|
395
391
|
onKeyDown={handleKeyDown}
|
|
396
392
|
onKeyUp={handleKeyUp}
|
|
@@ -428,7 +424,8 @@ const LineChart = (props) => {
|
|
|
428
424
|
options={{
|
|
429
425
|
onClick,
|
|
430
426
|
onHover,
|
|
431
|
-
maintainAspectRatio:
|
|
427
|
+
maintainAspectRatio:
|
|
428
|
+
chartStyling.squareAspectRatio || chartStyling.maintainAspectRatio,
|
|
432
429
|
aspectRatio: chartStyling.squareAspectRatio ? 1 : null, // 1 equals square aspect ratio
|
|
433
430
|
animation: {
|
|
434
431
|
duration: chartStyling.performanceMode
|
|
@@ -149,6 +149,26 @@ const TemplateWithCustomLegendContainer = (args) => {
|
|
|
149
149
|
|
|
150
150
|
export const Default = Template.bind({});
|
|
151
151
|
|
|
152
|
+
export const FillContainer = Template.bind({});
|
|
153
|
+
FillContainer.args = {
|
|
154
|
+
chart: {
|
|
155
|
+
...basicChart,
|
|
156
|
+
options: {
|
|
157
|
+
...basicChart.options,
|
|
158
|
+
chartStyling: {
|
|
159
|
+
height: '100%',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
FillContainer.decorators = [
|
|
165
|
+
(Story) => (
|
|
166
|
+
<div style={{ height: 400, width: 500 }}>
|
|
167
|
+
<Story />
|
|
168
|
+
</div>
|
|
169
|
+
),
|
|
170
|
+
];
|
|
171
|
+
|
|
152
172
|
export const DataGaps = Template.bind({});
|
|
153
173
|
DataGaps.args = {
|
|
154
174
|
chart: {
|
|
@@ -422,3 +442,26 @@ SquareAspectRatio.args = {
|
|
|
422
442
|
},
|
|
423
443
|
},
|
|
424
444
|
};
|
|
445
|
+
|
|
446
|
+
export const SquareAspectRatioFillContainer = Template.bind({});
|
|
447
|
+
SquareAspectRatioFillContainer.args = {
|
|
448
|
+
chart: {
|
|
449
|
+
...basicChart,
|
|
450
|
+
options: {
|
|
451
|
+
...basicChart.options,
|
|
452
|
+
title: 'Square aspect ratio',
|
|
453
|
+
chartStyling: {
|
|
454
|
+
squareAspectRatio: true,
|
|
455
|
+
maintainAspectRatio: true,
|
|
456
|
+
height: '100%',
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
SquareAspectRatioFillContainer.decorators = [
|
|
462
|
+
(Story) => (
|
|
463
|
+
<div style={{ display: 'flex', height: 400, width: 600 }}>
|
|
464
|
+
<Story />
|
|
465
|
+
</div>
|
|
466
|
+
),
|
|
467
|
+
];
|