@millistream/millistream-widgets 0.0.21 → 1.0.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/README.md +56 -33
- package/millistream-widgets.js +16 -17
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -45,12 +45,66 @@ loadChart) {
|
|
|
45
45
|
gridHorizontalLines: 0,
|
|
46
46
|
gridHorizontalLinesStyle: 'normal',
|
|
47
47
|
gridVerticalLines: 1,
|
|
48
|
-
chartlen: '
|
|
48
|
+
chartlen: '2d',
|
|
49
49
|
dateformat: 'b dd',
|
|
50
50
|
drawyaxis: true,
|
|
51
51
|
fillchart: true,
|
|
52
52
|
timeformat: 'HH:mm',
|
|
53
53
|
streaming: pushapi,
|
|
54
|
+
fillchart: true,
|
|
55
|
+
timeformat: 'HH:mm',
|
|
56
|
+
streaming: pushapi,
|
|
57
|
+
instrumentStyle: {
|
|
58
|
+
color: '#f90',
|
|
59
|
+
backgroundLinearGradient: {
|
|
60
|
+
topColor: 'rgba(255,153,0,0.6)',
|
|
61
|
+
bottomColor: 'rgba(255,153,0,0.1)',
|
|
62
|
+
},
|
|
63
|
+
width: 1,
|
|
64
|
+
},
|
|
65
|
+
horizontalLegendStyle: {
|
|
66
|
+
fontSize: '11px',
|
|
67
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
68
|
+
},
|
|
69
|
+
verticalLegendStyle: {
|
|
70
|
+
fontSize: '11px',
|
|
71
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
72
|
+
},
|
|
73
|
+
tooltip: {
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
formatter: function () {
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
var date = formatDate(this.data.date, 'yyyy-mm-dd');
|
|
78
|
+
var time = '';
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
if (this.chartType == 'trades') {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
var hour = this.data.date.getHours();
|
|
83
|
+
var minute = '';
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
if (this.data.date.getMinutes() < 10) minute = '0';
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
minute += this.data.date.getMinutes();
|
|
88
|
+
time = hour + ':' + minute;
|
|
89
|
+
}
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
return (
|
|
92
|
+
'<span class="tooltip-name">' +
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
this.name +
|
|
95
|
+
'</span><br>' +
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
this.data.price +
|
|
98
|
+
', ' +
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
this.data.diff.toFixed(2) +
|
|
101
|
+
'%</br>' +
|
|
102
|
+
date +
|
|
103
|
+
' ' +
|
|
104
|
+
time
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
54
108
|
});
|
|
55
109
|
|
|
56
110
|
})();
|
|
@@ -67,19 +121,6 @@ loadChart) {
|
|
|
67
121
|
position: relative;
|
|
68
122
|
}
|
|
69
123
|
|
|
70
|
-
.millistream-chart {
|
|
71
|
-
margin-bottom: 30px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.millistream-chart-instrument {
|
|
75
|
-
color: #f90;
|
|
76
|
-
background-image: linear-gradient(
|
|
77
|
-
rgba(255, 153, 0, 0.6),
|
|
78
|
-
rgba(255, 153, 0, 0)
|
|
79
|
-
);
|
|
80
|
-
width: 2px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
124
|
.millistream-chart-tooltip {
|
|
84
125
|
position: absolute;
|
|
85
126
|
background: #ffffff;
|
|
@@ -88,7 +129,6 @@ loadChart) {
|
|
|
88
129
|
font-family: Arial, Helvetica, sans-serif;
|
|
89
130
|
font-size: 11px;
|
|
90
131
|
padding: 2px;
|
|
91
|
-
height: 14px;
|
|
92
132
|
pointer-events: none;
|
|
93
133
|
}
|
|
94
134
|
|
|
@@ -100,23 +140,6 @@ loadChart) {
|
|
|
100
140
|
pointer-events: none;
|
|
101
141
|
}
|
|
102
142
|
|
|
103
|
-
.millistream-chart-x-legend {
|
|
104
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
105
|
-
font-size: 11px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.millistream-chart-y-legend {
|
|
109
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
110
|
-
font-size: 11px;
|
|
111
|
-
float: left;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.millistream-chart-y2-legend {
|
|
115
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
116
|
-
font-size: 11px;
|
|
117
|
-
float: right;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
143
|
.millistream-chart-zoombox {
|
|
121
144
|
position: absolute;
|
|
122
145
|
background: rgb(255, 153, 0, 0.1);
|
|
@@ -129,4 +152,4 @@ Please refer to non npm-version documentation on widget customization.
|
|
|
129
152
|
https://widgets.millistream.com/3.0.3/doc/widgets.html
|
|
130
153
|
|
|
131
154
|
## Support
|
|
132
|
-
https://www.millistream.com
|
|
155
|
+
https://www.millistream.com
|
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 = {
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@millistream/millistream-widgets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.2",
|
|
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
|
}
|