@millistream/millistream-widgets 0.0.20 → 1.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/millistream-widgets.js +17 -17
- package/package.json +5 -2
package/millistream-widgets.js
CHANGED
|
@@ -91,18 +91,13 @@ function Milli_Chart(settings) {
|
|
|
91
91
|
|
|
92
92
|
var m_chartCss = {
|
|
93
93
|
backgroundColor: '#fffcf8',
|
|
94
|
-
marginTop:
|
|
95
|
-
marginBottom:
|
|
96
|
-
marginLeft:
|
|
97
|
-
marginRight:
|
|
98
|
-
boxShadow: {
|
|
99
|
-
topWidth: 2,
|
|
100
|
-
rightWidth: 2,
|
|
101
|
-
color: '#02020230'
|
|
102
|
-
},
|
|
94
|
+
marginTop: 0,
|
|
95
|
+
marginBottom: 0,
|
|
96
|
+
marginLeft: 0,
|
|
97
|
+
marginRight: 0
|
|
103
98
|
};
|
|
104
|
-
if (_this.settings.
|
|
105
|
-
MillistreamWidgetApi_AssignObject(_this.settings.
|
|
99
|
+
if (_this.settings.chartStyle) {
|
|
100
|
+
MillistreamWidgetApi_AssignObject(_this.settings.chartStyle, m_chartCss);
|
|
106
101
|
}
|
|
107
102
|
var m_xLegendCss = {
|
|
108
103
|
fontSize: '10px',
|
|
@@ -659,7 +654,7 @@ function Milli_Chart(settings) {
|
|
|
659
654
|
if ((number == 1 && _this.settings.drawyaxis == true) || (number == 2 && _this.settings.drawy2axis == true)) {
|
|
660
655
|
var label;
|
|
661
656
|
if (number == 2)
|
|
662
|
-
label = formatNiceNumber(value, _this.settings.thousandseparator, _this.settings.decimalseparator, si.decimals, true);
|
|
657
|
+
label = formatNiceNumber(value, _this.settings.thousandseparator, _this.settings.decimalseparator, si.decimals, true) + '%';
|
|
663
658
|
else
|
|
664
659
|
label = formatNiceNumber(value, _this.settings.thousandseparator, _this.settings.decimalseparator, si.decimals, false);
|
|
665
660
|
var textpos = x - 5;
|
|
@@ -1764,20 +1759,20 @@ function Milli_Chart(settings) {
|
|
|
1764
1759
|
};
|
|
1765
1760
|
|
|
1766
1761
|
function drawBoxShadow(space) {
|
|
1767
|
-
if (typeof m_chartCss.boxShadow === 'undefined'
|
|
1762
|
+
if (typeof m_chartCss.boxShadow === 'undefined' || typeof m_chartCss.boxShadow.color === 'undefined') return;
|
|
1768
1763
|
m_ctx.save();
|
|
1769
1764
|
m_ctx.beginPath();
|
|
1770
1765
|
m_ctx.strokeStyle = m_chartCss.boxShadow.color;
|
|
1771
1766
|
if (typeof m_chartCss.boxShadow.topWidth !== 'undefined' && m_chartCss.boxShadow.topWidth > 0) {
|
|
1772
1767
|
m_ctx.lineWidth = m_chartCss.boxShadow.topWidth;
|
|
1773
|
-
m_ctx.moveTo(space.left, space.top);
|
|
1774
|
-
m_ctx.lineTo(space.right, space.top);
|
|
1768
|
+
m_ctx.moveTo(space.left + 0.5, space.top + 0.5);
|
|
1769
|
+
m_ctx.lineTo(space.right + 0.5, space.top + 0.5);
|
|
1775
1770
|
m_ctx.stroke();
|
|
1776
1771
|
}
|
|
1777
1772
|
if (typeof m_chartCss.boxShadow.rightWidth !== 'undefined' && m_chartCss.boxShadow.rightWidth > 0) {
|
|
1778
1773
|
m_ctx.lineWidth = m_chartCss.boxShadow.rightWidth;
|
|
1779
|
-
m_ctx.moveTo(space.right, space.top + 0.5);
|
|
1780
|
-
m_ctx.lineTo(space.right, space.bottom);
|
|
1774
|
+
m_ctx.moveTo(space.right + 0.5, space.top + 0.5);
|
|
1775
|
+
m_ctx.lineTo(space.right + 0.5, space.bottom + 0.5);
|
|
1781
1776
|
m_ctx.stroke();
|
|
1782
1777
|
}
|
|
1783
1778
|
m_ctx.closePath();
|
|
@@ -3549,6 +3544,9 @@ function MillistreamWidgetApi_getColumnInfo(widget, name) {
|
|
|
3549
3544
|
case '1022':
|
|
3550
3545
|
case 'marketcap':
|
|
3551
3546
|
return [1022, 'numeric', 'right', widget.get_lang_text(name) || name, 12];
|
|
3547
|
+
case '54':
|
|
3548
|
+
case 'marketplace':
|
|
3549
|
+
return [54, 'numeric', 'left', widget.get_lang_text(name) || name, 0];
|
|
3552
3550
|
case 'marketplacename':
|
|
3553
3551
|
return [0, 'string', 'left', widget.get_lang_text(name) || name, 0];
|
|
3554
3552
|
case '119':
|
|
@@ -4691,6 +4689,7 @@ var MillistreamWidgetSettings = {
|
|
|
4691
4689
|
thousandseparator: ' ',
|
|
4692
4690
|
streaming: false
|
|
4693
4691
|
};
|
|
4692
|
+
|
|
4694
4693
|
function MillistreamWidgetStreamingApi(settings) {
|
|
4695
4694
|
var _this = this;
|
|
4696
4695
|
_this.settings = {
|
|
@@ -5091,6 +5090,7 @@ function MillistreamWidgetStreamingApi(settings) {
|
|
|
5091
5090
|
}
|
|
5092
5091
|
exports.Milli_Chart = Milli_Chart;
|
|
5093
5092
|
exports.MillistreamWidgetSettings = MillistreamWidgetSettings;
|
|
5093
|
+
exports.formatDate = formatDate;
|
|
5094
5094
|
exports.MillistreamWidgetStreamingApi = MillistreamWidgetStreamingApi;
|
|
5095
5095
|
|
|
5096
5096
|
exports.setDataApiUrl = function(url) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@millistream/millistream-widgets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Millistream widgets node package",
|
|
5
5
|
"main": "millistream-widgets.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
9
|
"author": "Mats Fors (http://www.millistream.com)",
|
|
10
|
-
"license": "GPL-3.0"
|
|
10
|
+
"license": "GPL-3.0",
|
|
11
|
+
"repository": {
|
|
12
|
+
"private": true
|
|
13
|
+
}
|
|
11
14
|
}
|