@rongmz/trading-charts
Version:
This is a d3 based charting library for stocks and finance world. If the question is, why another chart library? - Coz, I find no "open-source" library fits my requirements.
119 lines • 3.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EVENT_PAN = exports.EVENT_ZOOM = exports.getLineDash = exports.error = exports.warn = exports.log = exports.debug = exports.DarkThemeChartSettings = exports.LightThemeChartSettings = exports.X_AXIS_HEIGHT_PX = exports.MIN_ZOOM_POINTS = exports.DEAFULT_ZOOM_LEVEL = exports.CLASS_SUBGRAPH = void 0;
exports.CLASS_SUBGRAPH = 'rongmz_subgraph';
exports.DEAFULT_ZOOM_LEVEL = 0.8;
exports.MIN_ZOOM_POINTS = 3;
exports.X_AXIS_HEIGHT_PX = 25;
exports.LightThemeChartSettings = {
graphSeparatorColor: '#00000054',
crossHairWidth: 1,
crossHairColor: '#3d3d3d',
crossHairContrastColor: '#ffffff',
background: '#FFFFFFFF',
gridLinesType: 'both',
gridLinesColor: '#00000010',
xGridInterval: 7,
scaleLineColor: '#00000030',
scaleFontColor: '#000000',
scaleFontSize: '12px Arial',
watermarkText: '',
title: '@rongmz/trading-charts',
yScaleTitle: '₹',
legendPosition: 'top-left',
legendFontSize: '12px Arial',
legendFormat: '.3~f',
lineWidth: 1,
plotSectionRatio: 0.94,
yScaleTickCount: 5,
legendMargin: 10,
yScalePaddingPct: 0.1,
xScalePadding: 0.2,
zoomLevel: exports.DEAFULT_ZOOM_LEVEL,
wheelZoomSensitivity: 0.01,
xScaleFormat: '%d/%m, %H:%M',
xScaleCrossHairFormat: '%d/%m, %H:%M',
crossHairYScaleFormat: '.2~f',
titlePlacement: 'top-right',
annotationLineWidth: 1,
annotationFontSize: '12px Arial',
};
exports.DarkThemeChartSettings = {
graphSeparatorColor: '#FFFFFF54',
crossHairWidth: 1,
crossHairColor: '#E8E8E8',
crossHairContrastColor: '#000000',
background: '#000000FF',
gridLinesType: 'both',
gridLinesColor: '#FFFFFF10',
xGridInterval: 7,
scaleLineColor: '#FFFFFF30',
scaleFontColor: '#FFFFFF',
scaleFontSize: '12px Arial',
watermarkText: '',
title: '@rongmz/trading-charts',
yScaleTitle: '₹',
legendPosition: 'top-left',
legendFontSize: '12px Arial',
legendFormat: '.3~f',
lineWidth: 1,
plotSectionRatio: 0.94,
yScaleTickCount: 5,
legendMargin: 10,
yScalePaddingPct: 0.1,
xScalePadding: 0.2,
zoomLevel: exports.DEAFULT_ZOOM_LEVEL,
wheelZoomSensitivity: 0.01,
xScaleFormat: '%d/%m, %H:%M',
xScaleCrossHairFormat: '%d/%m, %H:%M',
crossHairYScaleFormat: '.2~f',
titlePlacement: 'top-right',
annotationLineWidth: 1,
annotationFontSize: '12px Arial',
};
var debug = function () {
var msg = [];
for (var _i = 0; _i < arguments.length; _i++) {
msg[_i] = arguments[_i];
}
return console.log.apply(console, msg);
};
exports.debug = debug;
var log = function () {
var msg = [];
for (var _i = 0; _i < arguments.length; _i++) {
msg[_i] = arguments[_i];
}
return console.log.apply(console, msg);
};
exports.log = log;
var warn = function () {
var msg = [];
for (var _i = 0; _i < arguments.length; _i++) {
msg[_i] = arguments[_i];
}
return console.warn.apply(console, msg);
};
exports.warn = warn;
var error = function () {
var msg = [];
for (var _i = 0; _i < arguments.length; _i++) {
msg[_i] = arguments[_i];
}
return console.error.apply(console, msg);
};
exports.error = error;
var getLineDash = function (type) {
switch (type) {
case 'solid':
return [16, 0];
case 'dashed':
return [4, 16];
case 'dotted':
return [2, 2];
}
};
exports.getLineDash = getLineDash;
exports.EVENT_ZOOM = 'onzoom';
exports.EVENT_PAN = 'onpan';
//# sourceMappingURL=types.js.map