@hpcc-js/amchart
Advanced tools
Comparing version 0.0.1 to 0.0.5
128
lib/Area.js
@@ -1,62 +0,72 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
require("../src/Area.css"); | ||
var Area = (function (_super) { | ||
tslib_1.__extends(Area, _super); | ||
function Area() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "line"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Area.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Area.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "./CommonSerial", "../src/Area.css"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
require("../src/Area.css"); | ||
var Area = (function (_super) { | ||
tslib_1.__extends(Area, _super); | ||
function Area() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "line"; | ||
return _this; | ||
} | ||
else { | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Area.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
// Area Specific Options | ||
gObj.fillAlphas = this.fillOpacity(); | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
return gObj; | ||
} | ||
}; | ||
Area.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Area; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Area = Area; | ||
Area.prototype._class += " amchart_Area"; | ||
Area.prototype.implements(api_1.INDChart.prototype); | ||
Area.prototype.publish("paletteID", "default", "set", "Palette ID", Area.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Area.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Area.prototype.publish("fillOpacity", 0.7, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Area.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%"], { tags: ["Basic"] }); | ||
Area.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Area.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
Area.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Area.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
} | ||
else { | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Area.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
// Area Specific Options | ||
gObj.fillAlphas = this.fillOpacity(); | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
return gObj; | ||
} | ||
}; | ||
Area.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Area; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Area = Area; | ||
Area.prototype._class += " amchart_Area"; | ||
Area.prototype.implements(api_1.INDChart.prototype); | ||
Area.prototype.publish("paletteID", "default", "set", "Palette ID", Area.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Area.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Area.prototype.publish("fillOpacity", 0.7, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Area.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%"], { tags: ["Basic"] }); | ||
Area.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Area.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=Area.js.map |
@@ -1,24 +0,34 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var common_1 = require("@hpcc-js/common"); | ||
var Axis = (function (_super) { | ||
tslib_1.__extends(Axis, _super); | ||
function Axis() { | ||
return _super.call(this) || this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Axis.prototype.id = function (_) { | ||
if (!arguments.length) | ||
return this._id; | ||
this._id = _; | ||
return this; | ||
}; | ||
Axis.prototype.render = function (callback) { | ||
this._owningWidget.render(callback); | ||
}; | ||
return Axis; | ||
}(common_1.PropertyExt)); | ||
exports.Axis = Axis; | ||
Axis.prototype._class += " amchart_Axis"; | ||
Axis.prototype.publish("type", null, "set", "X/Y Axis Text Font Size", ["x", "y"], { tags: ["Basic", "Shared"] }); // just incase we need it | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/common"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var common_1 = require("@hpcc-js/common"); | ||
var Axis = (function (_super) { | ||
tslib_1.__extends(Axis, _super); | ||
function Axis() { | ||
return _super.call(this) || this; | ||
} | ||
Axis.prototype.id = function (_) { | ||
if (!arguments.length) | ||
return this._id; | ||
this._id = _; | ||
return this; | ||
}; | ||
Axis.prototype.render = function (callback) { | ||
this._owningWidget.render(callback); | ||
}; | ||
return Axis; | ||
}(common_1.PropertyExt)); | ||
exports.Axis = Axis; | ||
Axis.prototype._class += " amchart_Axis"; | ||
Axis.prototype.publish("type", null, "set", "X/Y Axis Text Font Size", ["x", "y"], { tags: ["Basic", "Shared"] }); // just incase we need it | ||
}); | ||
//# sourceMappingURL=Axis.js.map |
@@ -1,18 +0,28 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Column_1 = require("./Column"); | ||
var Bar = (function (_super) { | ||
tslib_1.__extends(Bar, _super); | ||
function Bar() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
_this.orientation("vertical"); | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
return Bar; | ||
}(Column_1.Column)); | ||
exports.Bar = Bar; | ||
Bar.prototype._class += " amchart_Bar"; | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "./Column"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Column_1 = require("./Column"); | ||
var Bar = (function (_super) { | ||
tslib_1.__extends(Bar, _super); | ||
function Bar() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
_this.orientation("vertical"); | ||
return _this; | ||
} | ||
return Bar; | ||
}(Column_1.Column)); | ||
exports.Bar = Bar; | ||
Bar.prototype._class += " amchart_Bar"; | ||
}); | ||
//# sourceMappingURL=Bar.js.map |
@@ -1,112 +0,122 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
var Column = (function (_super) { | ||
tslib_1.__extends(Column, _super); | ||
function Column() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
_this.orientation("horizontal"); | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Column.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Column.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
if (this._rangeType === "candle-ohlc") { | ||
this._gType = this.useOhlcLines() ? "ohlc" : "candlestick"; | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "./CommonSerial"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
var Column = (function (_super) { | ||
tslib_1.__extends(Column, _super); | ||
function Column() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
_this.orientation("horizontal"); | ||
return _this; | ||
} | ||
else { | ||
this._gType = "column"; | ||
} | ||
this.buildGraphs(this._gType); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
} | ||
else { | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
if (this.yAxisDomainLow_exists()) { | ||
this._chart.valueAxes[0].minimum = this.yAxisDomainLow(); | ||
} | ||
if (this.yAxisDomainHigh_exists()) { | ||
this._chart.valueAxes[0].maximum = this.yAxisDomainHigh(); | ||
} | ||
this._chart.valueAxes[0].strictMinMax = false; | ||
if (this.yAxisLabelFrequency_exists()) { | ||
this._chart.valueAxes[0].labelFrequency = this.yAxisLabelFrequency(); | ||
} | ||
if (this.yAxisBaseValue_exists()) { | ||
this._chart.valueAxes[0].baseValue = this.yAxisBaseValue(); | ||
} | ||
if (this.yAxisTickCount_exists()) { | ||
this._chart.valueAxes[0].gridCount = this.yAxisTickCount(); | ||
} | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
this._chart.categoryAxis.startOnAxis = false; | ||
return this._chart; | ||
}; | ||
Column.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
if (this.columnWidth()) { | ||
gObj.columnWidth = this.columnWidth(); | ||
Column.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Column.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
if (this._rangeType === "candle-ohlc") { | ||
this._gType = this.useOhlcLines() ? "ohlc" : "candlestick"; | ||
} | ||
if (this.cylinderBars()) { | ||
gObj.topRadius = this.circleRadius(); | ||
else { | ||
this._gType = "column"; | ||
} | ||
this.buildGraphs(this._gType); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
} | ||
else { | ||
gObj.topRadius = undefined; | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
if (this._rangeType === "normal") { | ||
gObj.openField = "openField" + i; | ||
gObj.valueField = "valueField" + i; | ||
if (this.yAxisDomainLow_exists()) { | ||
this._chart.valueAxes[0].minimum = this.yAxisDomainLow(); | ||
} | ||
if (this._rangeType === "candle-ohlc") { | ||
gObj.lowField = "lowField" + i; | ||
gObj.openField = "openField" + i; | ||
gObj.closeField = "closeField" + i; | ||
gObj.highField = "highField" + i; | ||
if (this.yAxisDomainHigh_exists()) { | ||
this._chart.valueAxes[0].maximum = this.yAxisDomainHigh(); | ||
} | ||
gObj.fillAlphas = this.fillOpacity(); | ||
return gObj; | ||
} | ||
}; | ||
Column.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Column; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Column = Column; | ||
Column.prototype._class += " amchart_Column"; | ||
Column.prototype.implements(api_1.INDChart.prototype); | ||
Column.prototype.publish("paletteID", "default", "set", "Palette ID", Column.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Column.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Column.prototype.publish("fillOpacity", 0.7, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Column.prototype.publish("cylinderBars", false, "boolean", "Cylinder Bars", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("circleRadius", 1, "number", "Circle Radius of Cylinder Bars", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("columnWidth", 0.62, "number", "Column Width", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%", "3d"], { tags: ["Basic"] }); | ||
Column.prototype.publish("useOhlcLines", false, "boolean", "Use OHLC Lines", null, { tags: ["Intermediate"] }); | ||
Column.prototype.publish("yAxisDomainLow", null, "number", "Y axis Minimum value", null, { optional: true }); | ||
Column.prototype.publish("yAxisDomainHigh", null, "number", "Y axis Maximum value", null, { optional: true }); | ||
Column.prototype.publish("yAxisBaseValue", null, "number", "Y axis base value", null, { optional: true }); | ||
Column.prototype.publish("yAxisLabelFrequency", 1, "number", "Y axis label frequency", null, { optional: true }); | ||
Column.prototype.publish("yAxisTickCount", null, "number", "Y axis grid count", null, { optional: true }); | ||
this._chart.valueAxes[0].strictMinMax = false; | ||
if (this.yAxisLabelFrequency_exists()) { | ||
this._chart.valueAxes[0].labelFrequency = this.yAxisLabelFrequency(); | ||
} | ||
if (this.yAxisBaseValue_exists()) { | ||
this._chart.valueAxes[0].baseValue = this.yAxisBaseValue(); | ||
} | ||
if (this.yAxisTickCount_exists()) { | ||
this._chart.valueAxes[0].gridCount = this.yAxisTickCount(); | ||
} | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
this._chart.categoryAxis.startOnAxis = false; | ||
return this._chart; | ||
}; | ||
Column.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
if (this.columnWidth()) { | ||
gObj.columnWidth = this.columnWidth(); | ||
} | ||
if (this.cylinderBars()) { | ||
gObj.topRadius = this.circleRadius(); | ||
} | ||
else { | ||
gObj.topRadius = undefined; | ||
} | ||
if (this._rangeType === "normal") { | ||
gObj.openField = "openField" + i; | ||
gObj.valueField = "valueField" + i; | ||
} | ||
if (this._rangeType === "candle-ohlc") { | ||
gObj.lowField = "lowField" + i; | ||
gObj.openField = "openField" + i; | ||
gObj.closeField = "closeField" + i; | ||
gObj.highField = "highField" + i; | ||
} | ||
gObj.fillAlphas = this.fillOpacity(); | ||
return gObj; | ||
} | ||
}; | ||
Column.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Column; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Column = Column; | ||
Column.prototype._class += " amchart_Column"; | ||
Column.prototype.implements(api_1.INDChart.prototype); | ||
Column.prototype.publish("paletteID", "default", "set", "Palette ID", Column.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Column.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Column.prototype.publish("fillOpacity", 0.7, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Column.prototype.publish("cylinderBars", false, "boolean", "Cylinder Bars", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("circleRadius", 1, "number", "Circle Radius of Cylinder Bars", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("columnWidth", 0.62, "number", "Column Width", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Column.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%", "3d"], { tags: ["Basic"] }); | ||
Column.prototype.publish("useOhlcLines", false, "boolean", "Use OHLC Lines", null, { tags: ["Intermediate"] }); | ||
Column.prototype.publish("yAxisDomainLow", null, "number", "Y axis Minimum value", null, { optional: true }); | ||
Column.prototype.publish("yAxisDomainHigh", null, "number", "Y axis Maximum value", null, { optional: true }); | ||
Column.prototype.publish("yAxisBaseValue", null, "number", "Y axis base value", null, { optional: true }); | ||
Column.prototype.publish("yAxisLabelFrequency", 1, "number", "Y axis label frequency", null, { optional: true }); | ||
Column.prototype.publish("yAxisTickCount", null, "number", "Y axis grid count", null, { optional: true }); | ||
}); | ||
//# sourceMappingURL=Column.js.map |
146
lib/Combo.js
@@ -1,73 +0,83 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
require("../src/Combo.css"); | ||
var Combo = (function (_super) { | ||
tslib_1.__extends(Combo, _super); | ||
function Combo() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Combo.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Combo.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "./CommonSerial", "../src/Combo.css"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
require("../src/Combo.css"); | ||
var Combo = (function (_super) { | ||
tslib_1.__extends(Combo, _super); | ||
function Combo() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
else { | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
this.buildGraphs(); | ||
this._chart.categoryAxis.startOnAxis = false; | ||
return this._chart; | ||
}; | ||
Combo.prototype.buildGraphs = function () { | ||
this._chart.graphs = []; | ||
var gType; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
gType = this.types()[i] || this.defaultType(); | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
// Combo Specific Options | ||
if (gType !== "line") { | ||
gObj.fillAlphas = this.fillOpacity(); | ||
Combo.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Combo.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
// Stacked | ||
if (this.stacked()) { | ||
this._chart.valueAxes[0].stackType = this.stackType(); | ||
} | ||
if (gType !== "column") { | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
else { | ||
this._chart.valueAxes[0].stackType = "none"; | ||
} | ||
gObj.valueField = this.columns()[i + 1]; | ||
gObj.type = gObj.type === "area" ? "line" : gObj.type; // an area chart is a line chart with fillOpacity set | ||
return gObj; | ||
} | ||
}; | ||
Combo.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Combo; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Combo = Combo; | ||
Combo.prototype._class += " amchart_Combo"; | ||
Combo.prototype.implements(api_1.INDChart.prototype); | ||
Combo.prototype.publish("paletteID", "default", "set", "Palette ID", Combo.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Combo.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Combo.prototype.publish("fillOpacity", 0.2, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Combo.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Combo.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("defaultType", "column", "set", "Default chart type", ["column", "line", "spline", "area", "area-spline", "step", "area-step", "scatter"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("types", [], "array", "Array of chart types (ex:bar|line|spline|area|area-spline|step|area-step|scatter)", null, { tags: ["Basic"] }); | ||
Combo.prototype.publish("charts", [], "widgetArray", "widgets", null, { tags: ["Basic"] }); // perhaps we want to load up the params on a chart and pass in the chart and just read the params there? | ||
this.buildGraphs(); | ||
this._chart.categoryAxis.startOnAxis = false; | ||
return this._chart; | ||
}; | ||
Combo.prototype.buildGraphs = function () { | ||
this._chart.graphs = []; | ||
var gType; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
gType = this.types()[i] || this.defaultType(); | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, i) { | ||
// Combo Specific Options | ||
if (gType !== "line") { | ||
gObj.fillAlphas = this.fillOpacity(); | ||
} | ||
if (gType !== "column") { | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
} | ||
gObj.valueField = this.columns()[i + 1]; | ||
gObj.type = gObj.type === "area" ? "line" : gObj.type; // an area chart is a line chart with fillOpacity set | ||
return gObj; | ||
} | ||
}; | ||
Combo.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Combo; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Combo = Combo; | ||
Combo.prototype._class += " amchart_Combo"; | ||
Combo.prototype.implements(api_1.INDChart.prototype); | ||
Combo.prototype.publish("paletteID", "default", "set", "Palette ID", Combo.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Combo.prototype.publish("stacked", false, "boolean", "Stack Chart", null, { tags: ["Basic", "Shared"] }); | ||
Combo.prototype.publish("fillOpacity", 0.2, "number", "Opacity of The Fill Color", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
Combo.prototype.publish("stackType", "regular", "set", "Stack Type", ["none", "regular", "100%"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Combo.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("defaultType", "column", "set", "Default chart type", ["column", "line", "spline", "area", "area-spline", "step", "area-step", "scatter"], { tags: ["Basic"] }); | ||
Combo.prototype.publish("types", [], "array", "Array of chart types (ex:bar|line|spline|area|area-spline|step|area-step|scatter)", null, { tags: ["Basic"] }); | ||
Combo.prototype.publish("charts", [], "widgetArray", "widgets", null, { tags: ["Basic"] }); // perhaps we want to load up the params on a chart and pass in the chart and just read the params there? | ||
}); | ||
//# sourceMappingURL=Combo.js.map |
@@ -1,200 +0,210 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/funnel"); | ||
var d3_array_1 = require("d3-array"); | ||
var d3_selection_1 = require("d3-selection"); | ||
var AmCharts = window.AmCharts; | ||
var CommonFunnel = (function (_super) { | ||
tslib_1.__extends(CommonFunnel, _super); | ||
function CommonFunnel() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
CommonFunnel.prototype.updateChartOptions = function () { | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.rotate = this.flip(); | ||
this._chart.pullOutOnlyOne = this.selectionMode() === "simple"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.colorField = "sliceColor"; | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.labelPosition = this.labelPosition(); | ||
this.titles = []; | ||
this.baloon = {}; | ||
this._chart.titleField = this.columns()[0]; | ||
this._chart.valueField = this.columns()[1]; | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
var sortingMethod = function (a, b) { return a[1] > b[1] ? 1 : -1; }; | ||
if (this.reverseDataSorting()) { | ||
sortingMethod = function (a, b) { return a[1] < b[1] ? 1 : -1; }; | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/funnel", "d3-array", "d3-selection"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/funnel"); | ||
var d3_array_1 = require("d3-array"); | ||
var d3_selection_1 = require("d3-selection"); | ||
var AmCharts = window.AmCharts; | ||
var CommonFunnel = (function (_super) { | ||
tslib_1.__extends(CommonFunnel, _super); | ||
function CommonFunnel() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
this.data().sort(sortingMethod); | ||
// DataProvider | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
// Color Palette | ||
this._chart.colors = this.data().map(function (row) { | ||
return this._palette(row[0]); | ||
}, this); | ||
// Scroll Bar | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
CommonFunnel.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
CommonFunnel.prototype.updateChartOptions = function () { | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.rotate = this.flip(); | ||
this._chart.pullOutOnlyOne = this.selectionMode() === "simple"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.colorField = "sliceColor"; | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.labelPosition = this.labelPosition(); | ||
this.titles = []; | ||
this.baloon = {}; | ||
this._chart.titleField = this.columns()[0]; | ||
this._chart.valueField = this.columns()[1]; | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
var sortingMethod = function (a, b) { return a[1] > b[1] ? 1 : -1; }; | ||
if (this.reverseDataSorting()) { | ||
sortingMethod = function (a, b) { return a[1] < b[1] ? 1 : -1; }; | ||
} | ||
this.data().sort(sortingMethod); | ||
// DataProvider | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
// Color Palette | ||
this._chart.colors = this.data().map(function (row) { | ||
return this._palette(row[0]); | ||
}, this); | ||
// Scroll Bar | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
CommonFunnel.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
return dataObjArr; | ||
}; | ||
CommonFunnel.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "funnel", | ||
addClassNames: true, | ||
autoResize: true, | ||
autoMargins: true, | ||
chartScrollbar: {} | ||
return dataObjArr; | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickSlice", function (e) { | ||
var field = e.chart.colorField; | ||
var data = e.dataItem.dataContext; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
CommonFunnel.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "funnel", | ||
addClassNames: true, | ||
autoResize: true, | ||
autoMargins: true, | ||
chartScrollbar: {} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickSlice", function (e) { | ||
var field = e.chart.colorField; | ||
var data = e.dataItem.dataContext; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
} | ||
context._selected = null; | ||
} | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: 1, | ||
dIdx: e.dataItem.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: 1, | ||
dIdx: e.dataItem.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.dataItem.index]), context.columns()[1], context._selected !== null); | ||
}); | ||
}; | ||
CommonFunnel.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.dataItem.index]), context.columns()[1], context._selected !== null); | ||
}); | ||
}; | ||
CommonFunnel.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
CommonFunnel.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonFunnel.prototype.postUpdate = function (domNode, element) { | ||
var context = this; | ||
if (this.labelPosition() !== "center") { | ||
var containerBoundingClientRect_1 = context._element.select("svg").node().getBoundingClientRect(); // might need to change this selection (could get a bit more accurate results?) | ||
this.d3LabelSelection = element.selectAll(".amcharts-funnel-item"); | ||
var left_1 = []; | ||
var right_1 = []; | ||
this.d3LabelSelection.each(function (d, i) { | ||
var boundingRect = d3_selection_1.select(this).node().getBoundingClientRect(); | ||
var labelRightPos = boundingRect.right; | ||
if (labelRightPos > containerBoundingClientRect_1.right) { | ||
right_1.push(containerBoundingClientRect_1.right - labelRightPos); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
CommonFunnel.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonFunnel.prototype.postUpdate = function (domNode, element) { | ||
var context = this; | ||
if (this.labelPosition() !== "center") { | ||
var containerBoundingClientRect_1 = context._element.select("svg").node().getBoundingClientRect(); // might need to change this selection (could get a bit more accurate results?) | ||
this.d3LabelSelection = element.selectAll(".amcharts-funnel-item"); | ||
var left_1 = []; | ||
var right_1 = []; | ||
this.d3LabelSelection.each(function (d, i) { | ||
var boundingRect = d3_selection_1.select(this).node().getBoundingClientRect(); | ||
var labelRightPos = boundingRect.right; | ||
if (labelRightPos > containerBoundingClientRect_1.right) { | ||
right_1.push(containerBoundingClientRect_1.right - labelRightPos); | ||
} | ||
var labelLeftPos = boundingRect.left; | ||
if (labelLeftPos < containerBoundingClientRect_1.left) { | ||
left_1.push(labelLeftPos - containerBoundingClientRect_1.left); | ||
} | ||
}); | ||
var rightOffset = right_1.length ? d3_array_1.min(right_1) : 0; | ||
var leftOffset = left_1.length ? d3_array_1.min(left_1) : 0; | ||
var smallerOffset = 0; | ||
if (rightOffset < 0) { | ||
smallerOffset += rightOffset; | ||
} | ||
var labelLeftPos = boundingRect.left; | ||
if (labelLeftPos < containerBoundingClientRect_1.left) { | ||
left_1.push(labelLeftPos - containerBoundingClientRect_1.left); | ||
if (leftOffset < 0) { | ||
smallerOffset += leftOffset; | ||
} | ||
}); | ||
var rightOffset = right_1.length ? d3_array_1.min(right_1) : 0; | ||
var leftOffset = left_1.length ? d3_array_1.min(left_1) : 0; | ||
var smallerOffset = 0; | ||
if (rightOffset < 0) { | ||
smallerOffset += rightOffset; | ||
switch (this.labelPosition()) { | ||
case "right": | ||
this._chart.marginRight = Math.abs(smallerOffset); | ||
this._chart.marginLeft = 0; | ||
break; | ||
case "left": | ||
this._chart.marginLeft = Math.abs(smallerOffset); | ||
this._chart.marginRight = 0; | ||
break; | ||
} | ||
this._chart.validateNow(); | ||
} | ||
if (leftOffset < 0) { | ||
smallerOffset += leftOffset; | ||
}; | ||
CommonFunnel.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
switch (this.labelPosition()) { | ||
case "right": | ||
this._chart.marginRight = Math.abs(smallerOffset); | ||
this._chart.marginLeft = 0; | ||
break; | ||
case "left": | ||
this._chart.marginLeft = Math.abs(smallerOffset); | ||
this._chart.marginRight = 0; | ||
break; | ||
} | ||
this._chart.validateNow(); | ||
} | ||
}; | ||
CommonFunnel.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
return CommonFunnel; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonFunnel = CommonFunnel; | ||
CommonFunnel.prototype._class += " amchart_CommonFunnel"; | ||
CommonFunnel.prototype.implements(api_1.ITooltip.prototype); | ||
CommonFunnel.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonFunnel.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonFunnel.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonFunnel.prototype.publish("flip", true, "boolean", "Flip Chart", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("reverseDataSorting", false, "boolean", "Reverse Data Sorting", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("labelPosition", "center", "set", "Label Position", ["left", "right", "center"], { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("showScrollbar", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonFunnel.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
CommonFunnel.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
CommonFunnel.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonFunnel.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
return CommonFunnel; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonFunnel = CommonFunnel; | ||
CommonFunnel.prototype._class += " amchart_CommonFunnel"; | ||
CommonFunnel.prototype.implements(api_1.ITooltip.prototype); | ||
CommonFunnel.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonFunnel.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonFunnel.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonFunnel.prototype.publish("flip", true, "boolean", "Flip Chart", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("reverseDataSorting", false, "boolean", "Reverse Data Sorting", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("labelPosition", "center", "set", "Label Position", ["left", "right", "center"], { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("showScrollbar", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonFunnel.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
CommonFunnel.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
CommonFunnel.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonFunnel.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonFunnel.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=CommonFunnel.js.map |
@@ -1,228 +0,238 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/radar"); | ||
var d3_format_1 = require("d3-format"); | ||
var AmCharts = window.AmCharts; | ||
var CommonRadar = (function (_super) { | ||
tslib_1.__extends(CommonRadar, _super); | ||
function CommonRadar() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
CommonRadar.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.theme = "none"; | ||
this._chart.type = "radar"; | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.categoryField = this.columns()[0]; | ||
this._valueField = this.columns().slice(1); | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
if (this.marginLeft()) { | ||
this._chart.marginLeft = this.marginLeft(); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/radar", "d3-format"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/radar"); | ||
var d3_format_1 = require("d3-format"); | ||
var AmCharts = window.AmCharts; | ||
var CommonRadar = (function (_super) { | ||
tslib_1.__extends(CommonRadar, _super); | ||
function CommonRadar() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
if (this.marginRight()) { | ||
this._chart.marginRight = this.marginRight(); | ||
} | ||
if (this.marginTop()) { | ||
this._chart.marginTop = this.marginTop(); | ||
} | ||
if (this.marginBottom()) { | ||
this._chart.marginBottom = this.marginBottom(); | ||
} | ||
this.titles = []; | ||
// DataProvider | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
// ValueAxis | ||
this._chart.valueAxes[0].title = this.yAxisTitle(); | ||
this._chart.valueAxes[0].axisTitleOffset = this.yAxisTitleOffset(); | ||
this._chart.valueAxes[0].minimum = this.yAxisMinimum(); | ||
this._chart.valueAxes[0].axisAlpha = this.axisAlpha(); | ||
this._chart.valueAxes[0].dashLength = this.yAxisDashLength() || this.dashedLineStyle(); | ||
this._chart.valueAxes[0].axisColor = this.yAxisBaselineColor(); | ||
this._chart.valueAxes[0].axisThickness = this.axisLineWidth(); | ||
this._chart.valueAxes[0].titleColor = this.yAxisTitleFontColor(); | ||
this._chart.valueAxes[0].titleFontSize = this.yAxisTitleFontSize(); | ||
this._chart.valueAxes[0].fontSize = this.axisFontSize(); | ||
this._chart.valueAxes[0].color = this.yAxisFontColor(); | ||
this._chart.valueAxes[0].autoGridCount = this.yAxisAutoGridCount(); | ||
this._chart.valueAxes[0].gridPosition = this.yAxisGridPosition(); | ||
this._chart.valueAxes[0].labelFunction = function (d) { | ||
return d3_format_1.format(context.yAxisTickFormat())(d); | ||
CommonRadar.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.theme = "none"; | ||
this._chart.type = "radar"; | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.categoryField = this.columns()[0]; | ||
this._valueField = this.columns().slice(1); | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
if (this.marginLeft()) { | ||
this._chart.marginLeft = this.marginLeft(); | ||
} | ||
if (this.marginRight()) { | ||
this._chart.marginRight = this.marginRight(); | ||
} | ||
if (this.marginTop()) { | ||
this._chart.marginTop = this.marginTop(); | ||
} | ||
if (this.marginBottom()) { | ||
this._chart.marginBottom = this.marginBottom(); | ||
} | ||
this.titles = []; | ||
// DataProvider | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
// ValueAxis | ||
this._chart.valueAxes[0].title = this.yAxisTitle(); | ||
this._chart.valueAxes[0].axisTitleOffset = this.yAxisTitleOffset(); | ||
this._chart.valueAxes[0].minimum = this.yAxisMinimum(); | ||
this._chart.valueAxes[0].axisAlpha = this.axisAlpha(); | ||
this._chart.valueAxes[0].dashLength = this.yAxisDashLength() || this.dashedLineStyle(); | ||
this._chart.valueAxes[0].axisColor = this.yAxisBaselineColor(); | ||
this._chart.valueAxes[0].axisThickness = this.axisLineWidth(); | ||
this._chart.valueAxes[0].titleColor = this.yAxisTitleFontColor(); | ||
this._chart.valueAxes[0].titleFontSize = this.yAxisTitleFontSize(); | ||
this._chart.valueAxes[0].fontSize = this.axisFontSize(); | ||
this._chart.valueAxes[0].color = this.yAxisFontColor(); | ||
this._chart.valueAxes[0].autoGridCount = this.yAxisAutoGridCount(); | ||
this._chart.valueAxes[0].gridPosition = this.yAxisGridPosition(); | ||
this._chart.valueAxes[0].labelFunction = function (d) { | ||
return d3_format_1.format(context.yAxisTickFormat())(d); | ||
}; | ||
// Color Palette | ||
this._chart.colors = this.columns().filter(function (d, i) { return i > 0; }).map(function (row) { | ||
return this._palette(row); | ||
}, this); | ||
if (this.circularGrid()) { | ||
this._chart.valueAxes.forEach(function (va, i) { | ||
context._chart.valueAxes[i].gridType = "circles"; | ||
}); | ||
} | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
// Color Palette | ||
this._chart.colors = this.columns().filter(function (d, i) { return i > 0; }).map(function (row) { | ||
return this._palette(row); | ||
}, this); | ||
if (this.circularGrid()) { | ||
this._chart.valueAxes.forEach(function (va, i) { | ||
context._chart.valueAxes[i].gridType = "circles"; | ||
}); | ||
} | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
CommonRadar.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.balloonFunction = function (d) { | ||
var balloonText = d.category + ", " + context.columns()[d.graph.index + 1] + ": " + context.data()[d.index][d.graph.columnIndex + 1]; | ||
return balloonText; | ||
CommonRadar.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.balloonFunction = function (d) { | ||
var balloonText = d.category + ", " + context.columns()[d.graph.index + 1] + ": " + context.data()[d.index][d.graph.columnIndex + 1]; | ||
return balloonText; | ||
}; | ||
gObj.fillAlphas = context.fillOpacity(); | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.bullet = context.bulletType(); | ||
gObj.bulletSize = context.bulletSize(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.type = gType; | ||
gObj.title = ""; | ||
gObj.colorField = "selected" + i; | ||
return gObj; | ||
}; | ||
gObj.fillAlphas = context.fillOpacity(); | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.bullet = context.bulletType(); | ||
gObj.bulletSize = context.bulletSize(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.type = gType; | ||
gObj.title = ""; | ||
gObj.colorField = "selected" + i; | ||
return gObj; | ||
}; | ||
CommonRadar.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
CommonRadar.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
return dataObjArr; | ||
}; | ||
CommonRadar.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "radar", | ||
addClassNames: true, | ||
chartScrollbar: {} | ||
return dataObjArr; | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field = graph.colorField; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
CommonRadar.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "radar", | ||
addClassNames: true, | ||
chartScrollbar: {} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field = graph.colorField; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
} | ||
context._selected = null; | ||
} | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: e.target.index, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: e.target.index, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.index + 1], context._selected !== null); | ||
}); | ||
}; | ||
CommonRadar.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.index + 1], context._selected !== null); | ||
}); | ||
}; | ||
CommonRadar.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
}; | ||
CommonRadar.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonRadar.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
CommonRadar.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonRadar; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonRadar = CommonRadar; | ||
CommonRadar.prototype._class += " amchart_CommonRadar"; | ||
CommonRadar.prototype.implements(api_1.ITooltip.prototype); | ||
// NO X-Axis !!! | ||
CommonRadar.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonRadar.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("lineWidth", 2, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("lineOpacity", 1, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("dashedLineStyle", 0, "number", "", null, { tags: ["Advanced", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisBaselineColor", null, "html-color", "Axis color", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonRadar.prototype.publish("axisFontSize", undefined, "number", "Size of value labels text. Will use chart's fontSize if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisFontColor", undefined, "string", "Font Name", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitle", "", "string", "Y-Axis Title", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitleFontColor", null, "html-color", "Color of axis value labels. Will use chart's color if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitleFontSize", null, "html-color", "Font Size of axis value labels. Will use chart's color if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("showScrollbar", false, "boolean", "Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonRadar.prototype.publish("yAxisAutoGridCount", true, "boolean", "Specifies whether number of gridCount is specified automatically, acoarding to the axis size", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisGridPosition", "start", "set", "Specifies if a grid line is placed on the center of a cell or on the beginning of a cell", ["start", "middle"], { tags: ["Advanced"] }); | ||
// CommonRadar.prototype.publish("yAxisBoldPeriodBeginning", true, "boolean", "When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold.",null,{tags:["Advanced"]}); | ||
// CommonRadar.prototype.publish("yAxisFillAlpha", 0, "number", "Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.",null,{tags:["Intermediate"]}); | ||
// CommonRadar.prototype.publish("yAxisFillColor", "#FFFFFF", "html-color", "Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.",null,{tags:["Intermediate"]}); | ||
// CommonRadar.prototype.publish("yAxisGridAlpha", 0.2, "number", "Grid alpha.",null,{tags:["Intermediate"]}); | ||
CommonRadar.prototype.publish("yAxisMinimum", [], "array", "", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisTitleOffset", [], "array", "", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisDashLength", [], "array", "Length of a dash. 0 means line is not dashed.", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("axisAlpha", 1, "number", "Axis opacity", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("circularGrid", false, "boolean", "Circular Grid", null, { tags: ["Intermediate"] }); // not dynamic | ||
CommonRadar.prototype.publish("bulletSize", 9, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("fillOpacity", 0.3, "number", "Shape Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTickFormat", "", "string", "Y-Axis Tick Format", null, { optional: true }); | ||
CommonRadar.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonRadar.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
}; | ||
CommonRadar.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonRadar.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
CommonRadar.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonRadar; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonRadar = CommonRadar; | ||
CommonRadar.prototype._class += " amchart_CommonRadar"; | ||
CommonRadar.prototype.implements(api_1.ITooltip.prototype); | ||
// NO X-Axis !!! | ||
CommonRadar.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonRadar.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("lineWidth", 2, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("lineOpacity", 1, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("dashedLineStyle", 0, "number", "", null, { tags: ["Advanced", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisBaselineColor", null, "html-color", "Axis color", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonRadar.prototype.publish("axisFontSize", undefined, "number", "Size of value labels text. Will use chart's fontSize if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisFontColor", undefined, "string", "Font Name", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitle", "", "string", "Y-Axis Title", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitleFontColor", null, "html-color", "Color of axis value labels. Will use chart's color if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTitleFontSize", null, "html-color", "Font Size of axis value labels. Will use chart's color if not set.", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Basic", "Shared"] }); | ||
CommonRadar.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("showScrollbar", false, "boolean", "Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonRadar.prototype.publish("yAxisAutoGridCount", true, "boolean", "Specifies whether number of gridCount is specified automatically, acoarding to the axis size", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisGridPosition", "start", "set", "Specifies if a grid line is placed on the center of a cell or on the beginning of a cell", ["start", "middle"], { tags: ["Advanced"] }); | ||
// CommonRadar.prototype.publish("yAxisBoldPeriodBeginning", true, "boolean", "When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold.",null,{tags:["Advanced"]}); | ||
// CommonRadar.prototype.publish("yAxisFillAlpha", 0, "number", "Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.",null,{tags:["Intermediate"]}); | ||
// CommonRadar.prototype.publish("yAxisFillColor", "#FFFFFF", "html-color", "Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.",null,{tags:["Intermediate"]}); | ||
// CommonRadar.prototype.publish("yAxisGridAlpha", 0.2, "number", "Grid alpha.",null,{tags:["Intermediate"]}); | ||
CommonRadar.prototype.publish("yAxisMinimum", [], "array", "", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisTitleOffset", [], "array", "", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("yAxisDashLength", [], "array", "Length of a dash. 0 means line is not dashed.", null, { tags: ["Advanced"] }); | ||
CommonRadar.prototype.publish("axisAlpha", 1, "number", "Axis opacity", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("circularGrid", false, "boolean", "Circular Grid", null, { tags: ["Intermediate"] }); // not dynamic | ||
CommonRadar.prototype.publish("bulletSize", 9, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("fillOpacity", 0.3, "number", "Shape Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Intermediate"] }); | ||
CommonRadar.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonRadar.prototype.publish("yAxisTickFormat", "", "string", "Y-Axis Tick Format", null, { optional: true }); | ||
CommonRadar.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonRadar.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
}); | ||
//# sourceMappingURL=CommonRadar.js.map |
@@ -1,251 +0,200 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/serial"); | ||
var d3_format_1 = require("d3-format"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var SerialAxis_1 = require("./SerialAxis"); | ||
// import "amcharts3/amcharts/serial.css"; | ||
var AmCharts = window.AmCharts; | ||
var CommonSerial = (function (_super) { | ||
tslib_1.__extends(CommonSerial, _super); | ||
function CommonSerial() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._dateParserData = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._dateParserValue = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._colorObj = {}; | ||
_this._selectionObj = {}; | ||
_this._xAxis = new SerialAxis_1.SerialAxis(); | ||
_this._yAxis = new SerialAxis_1.SerialAxis(); | ||
_this._xAxis.owningWidget = _this; | ||
_this._yAxis.owningWidget = _this; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
CommonSerial.prototype.switchProperties = function (val) { | ||
if (val === true) { | ||
CommonSerial.prototype.excludeObjs = ["amchart_SerialAxis"]; | ||
// hide the regular ones with the exclude tags? | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/serial", "d3-format", "d3-time-format", "./SerialAxis"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/serial"); | ||
var d3_format_1 = require("d3-format"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var SerialAxis_1 = require("./SerialAxis"); | ||
// import "amcharts3/amcharts/serial.css"; | ||
var AmCharts = window.AmCharts; | ||
var CommonSerial = (function (_super) { | ||
tslib_1.__extends(CommonSerial, _super); | ||
function CommonSerial() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._dateParserData = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._dateParserValue = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._colorObj = {}; | ||
_this._selectionObj = {}; | ||
_this._xAxis = new SerialAxis_1.SerialAxis(); | ||
_this._yAxis = new SerialAxis_1.SerialAxis(); | ||
_this._xAxis.owningWidget = _this; | ||
_this._yAxis.owningWidget = _this; | ||
return _this; | ||
} | ||
else { | ||
CommonSerial.prototype.excludeObjs = []; | ||
} | ||
}; | ||
CommonSerial.prototype.xAxis = function (idx) { | ||
if (!this.xAxes()[idx]) { | ||
var xAxis = new SerialAxis_1.SerialAxis(); | ||
xAxis._owningWidget = this; | ||
this.xAxes()[idx] = xAxis; | ||
} | ||
return this.xAxes()[idx]; | ||
}; | ||
CommonSerial.prototype.yAxis = function (idx) { | ||
if (!this.yAxes()[idx]) { | ||
var yAxis = new SerialAxis_1.SerialAxis(); | ||
yAxis._owningWidget = this; | ||
this.yAxes()[idx] = yAxis; | ||
} | ||
return this.yAxes()[idx]; | ||
}; | ||
CommonSerial.prototype.formatData = function (d) { | ||
switch (this.xAxes()[0].axisType()) { | ||
case "time": | ||
return this.xAxes()[0]._parser(typeof d === "number" ? d.toString() : d); | ||
default: | ||
CommonSerial.prototype.switchProperties = function (val) { | ||
if (val === true) { | ||
CommonSerial.prototype.excludeObjs = ["amchart_SerialAxis"]; | ||
// hide the regular ones with the exclude tags? | ||
} | ||
else { | ||
CommonSerial.prototype.excludeObjs = []; | ||
} | ||
}; | ||
CommonSerial.prototype.xAxis = function (idx) { | ||
if (!this.xAxes()[idx]) { | ||
var xAxis = new SerialAxis_1.SerialAxis(); | ||
xAxis._owningWidget = this; | ||
this.xAxes()[idx] = xAxis; | ||
} | ||
return this.xAxes()[idx]; | ||
}; | ||
CommonSerial.prototype.yAxis = function (idx) { | ||
if (!this.yAxes()[idx]) { | ||
var yAxis = new SerialAxis_1.SerialAxis(); | ||
yAxis._owningWidget = this; | ||
this.yAxes()[idx] = yAxis; | ||
} | ||
return this.yAxes()[idx]; | ||
}; | ||
CommonSerial.prototype.formatData = function (d) { | ||
switch (this.xAxes()[0].axisType()) { | ||
case "time": | ||
return this.xAxes()[0]._parser(typeof d === "number" ? d.toString() : d); | ||
default: | ||
return d; | ||
} | ||
}; | ||
CommonSerial.prototype.formatValue = function (d) { | ||
if (!d) { | ||
return d; | ||
} | ||
}; | ||
CommonSerial.prototype.formatValue = function (d) { | ||
if (!d) { | ||
return d; | ||
} | ||
// NOT REALLY NEEDED | ||
if (d instanceof Array) { | ||
return d.map(function (item) { | ||
return this.formatValue(item); | ||
}, this); | ||
} | ||
switch (this.yAxes()[0].axisType()) { | ||
case "time": | ||
return this.yAxes()[0]._parser(typeof d === "number" ? d.toString() : d); | ||
default: | ||
if (typeof d === "string") { | ||
return +d; | ||
} | ||
return d; | ||
} | ||
}; | ||
CommonSerial.prototype.amFormatData = function (dataArr) { | ||
this._rangeType = null; | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
dataRow.forEach(function (cell, cIdx) { | ||
var colName = context.columns()[cIdx]; | ||
if (cell instanceof Array) { | ||
var idx = cIdx - 1; | ||
if (cell.length === 2) { | ||
dataObj["openField" + idx] = context.formatValue(cell[0]); | ||
dataObj["valueField" + idx] = context.formatValue(cell[1]); | ||
context._rangeType = "normal"; | ||
} | ||
// NOT REALLY NEEDED | ||
if (d instanceof Array) { | ||
return d.map(function (item) { | ||
return this.formatValue(item); | ||
}, this); | ||
} | ||
switch (this.yAxes()[0].axisType()) { | ||
case "time": | ||
return this.yAxes()[0]._parser(typeof d === "number" ? d.toString() : d); | ||
default: | ||
if (typeof d === "string") { | ||
return +d; | ||
} | ||
else { | ||
dataObj["lowField" + idx] = context.formatValue(cell[0]); | ||
dataObj["openField" + idx] = context.formatValue(cell[1]); | ||
dataObj["closeField" + idx] = context.formatValue(cell[2]); | ||
dataObj["highField" + idx] = context.formatValue(cell[3]); | ||
context._rangeType = "candle-ohlc"; | ||
return d; | ||
} | ||
}; | ||
CommonSerial.prototype.amFormatData = function (dataArr) { | ||
this._rangeType = null; | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
dataRow.forEach(function (cell, cIdx) { | ||
var colName = context.columns()[cIdx]; | ||
if (cell instanceof Array) { | ||
var idx = cIdx - 1; | ||
if (cell.length === 2) { | ||
dataObj["openField" + idx] = context.formatValue(cell[0]); | ||
dataObj["valueField" + idx] = context.formatValue(cell[1]); | ||
context._rangeType = "normal"; | ||
} | ||
else { | ||
dataObj["lowField" + idx] = context.formatValue(cell[0]); | ||
dataObj["openField" + idx] = context.formatValue(cell[1]); | ||
dataObj["closeField" + idx] = context.formatValue(cell[2]); | ||
dataObj["highField" + idx] = context.formatValue(cell[3]); | ||
context._rangeType = "candle-ohlc"; | ||
} | ||
} | ||
} | ||
else { | ||
if (cIdx === 0) { | ||
dataObj[colName] = context.formatData(cell); | ||
} | ||
else if (cIdx >= context.columns().length) { | ||
dataObj[colName] = cell; | ||
} | ||
else { | ||
dataObj[colName] = context.formatValue(cell); | ||
if (cIdx === 0) { | ||
dataObj[colName] = context.formatData(cell); | ||
} | ||
else if (cIdx >= context.columns().length) { | ||
dataObj[colName] = cell; | ||
} | ||
else { | ||
dataObj[colName] = context.formatValue(cell); | ||
} | ||
} | ||
} | ||
}); | ||
dataObj.__origRow = dataRow; | ||
dataObjArr.push(dataObj); | ||
}); | ||
dataObj.__origRow = dataRow; | ||
dataObjArr.push(dataObj); | ||
}); | ||
if (this.xAxisType() === "time") { | ||
var sortField_1 = context.columns()[0]; | ||
dataObjArr.sort(function (a, b) { | ||
return a[sortField_1] - b[sortField_1]; | ||
}); | ||
this.data(dataObjArr.map(function (row) { | ||
var retVal = row.__origRow; | ||
delete row.__origRow; | ||
return retVal; | ||
})); | ||
} | ||
return dataObjArr; | ||
}; | ||
CommonSerial.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.type = "serial"; | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.rotate = this.orientation() === "vertical"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.categoryAxis = {}; | ||
// this._chart.titles = []; | ||
var xAxis = this.xAxes()[0]; | ||
// xAxis.type("x"); | ||
this._chart.categoryAxis.position = xAxis.position() ? xAxis.position() : "bottom"; | ||
this._chart.categoryAxis.autoGridCount = xAxis.axisAutoGridCount(); | ||
this._chart.categoryAxis.gridPosition = xAxis.axisGridPosition(); | ||
this._chart.categoryAxis.axisAlpha = xAxis.axisAlpha(); | ||
this._chart.categoryAxis.gridAlpha = xAxis.axisGridAlpha(); | ||
this._chart.categoryAxis.startOnAxis = xAxis.startOnAxis(); | ||
this._chart.categoryAxis.labelRotation = xAxis.axisLabelRotation(); | ||
this._chart.categoryAxis.title = xAxis.axisTitle(); | ||
this._chart.categoryAxis.axisColor = xAxis.axisBaselineColor(); | ||
this._chart.categoryAxis.axisThickness = xAxis.axisLineWidth(); | ||
this._chart.categoryAxis.boldPeriodBeginning = xAxis.axisBoldPeriodBeginning(); | ||
this._chart.categoryAxis.dashLength = xAxis.axisDashLength(); | ||
this._chart.categoryAxis.fillAlpha = xAxis.axisFillAlpha(); | ||
this._chart.categoryAxis.fillColor = xAxis.axisFillColor(); | ||
this._chart.categoryAxis.fontSize = xAxis.axisFontSize(); | ||
this._chart.categoryAxis.color = xAxis.axisFontColor(); | ||
this._chart.categoryAxis.titleColor = xAxis.axisTitleFontColor(); | ||
this._chart.categoryAxis.titleFontSize = xAxis.axisTitleFontSize(); | ||
this._chart.categoryAxis.showFirstLabel = this.showFirstLabel(); | ||
this._chart.categoryAxis.showLastLabel = this.showLastLabel(); | ||
this._chart.categoryAxis.equalSpacing = this.equalSpacing(); | ||
switch (xAxis.axisType()) { | ||
case "time": | ||
this._chart.categoryAxis.parseDates = true; | ||
this._chart.categoryAxis.minPeriod = this.axisMinPeriod() ? this.axisMinPeriod() : undefined; | ||
this._chart.categoryAxis.logarithmic = false; | ||
if (xAxis.axisTickFormat()) { | ||
this.dataFormatter = d3_time_format_1.timeFormat(xAxis.axisTickFormat()); | ||
} | ||
else if (xAxis.axisTypeTimePattern()) { | ||
this.dataFormatter = d3_time_format_1.timeFormat(xAxis.axisTypeTimePattern()); | ||
} | ||
else { | ||
this.dataFormatter = function (v) { return v; }; | ||
} | ||
break; | ||
case "log": | ||
this._chart.categoryAxis.parseDates = false; | ||
this._chart.categoryAxis.logarithmic = true; | ||
this.dataFormatter = xAxis.axisTickFormat() ? d3_format_1.format(xAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
case "linear": | ||
/* falls through */ | ||
default: | ||
this._chart.categoryAxis.parseDates = false; | ||
this._chart.categoryAxis.logarithmic = false; | ||
this.dataFormatter = xAxis.axisTickFormat() ? d3_format_1.format(xAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
} | ||
this._chart.categoryAxis.labelFunction = function (v1, v2, v3) { | ||
switch (xAxis.axisType()) { | ||
case "time": | ||
return context.dataFormatter(xAxis.axisTickFormat() || xAxis.axisTypeTimePattern() ? new Date(v2) : v2); | ||
default: | ||
return context.dataFormatter(v1); | ||
if (this.xAxisType() === "time") { | ||
var sortField_1 = context.columns()[0]; | ||
dataObjArr.sort(function (a, b) { | ||
return a[sortField_1] - b[sortField_1]; | ||
}); | ||
this.data(dataObjArr.map(function (row) { | ||
var retVal = row.__origRow; | ||
delete row.__origRow; | ||
return retVal; | ||
})); | ||
} | ||
return dataObjArr; | ||
}; | ||
var _loop_1 = function (i) { | ||
var yAxis = this_1.yAxes()[i]; | ||
// yAxis.type("y"); | ||
if (!this_1._chart.valueAxes[i]) { | ||
this_1._chart.valueAxes.push(new AmCharts.ValueAxis()); | ||
} | ||
this_1._chart.valueAxes[i].id = "v" + i; | ||
this_1._chart.valueAxes[i].position = yAxis.position() ? yAxis.position() : "left"; | ||
this_1._chart.valueAxes[i].title = yAxis.axisTitle(); | ||
this_1._chart.valueAxes[i].titleColor = yAxis.axisTitleFontColor(); | ||
this_1._chart.valueAxes[i].titleFontSize = yAxis.axisTitleFontSize(); | ||
this_1._chart.valueAxes[i].axisThickness = yAxis.axisLineWidth(); | ||
this_1._chart.valueAxes[i].color = yAxis.axisFontColor(); | ||
this_1._chart.valueAxes[i].fontSize = yAxis.axisFontSize(); | ||
this_1._chart.valueAxes[i].axisColor = yAxis.axisBaselineColor(); | ||
this_1._chart.valueAxes[i].axisAlpha = yAxis.axisAlpha(); | ||
this_1._chart.valueAxes[i].fillColor = yAxis.axisFillColor(); | ||
this_1._chart.valueAxes[i].fillAlpha = yAxis.axisFillAlpha(); | ||
this_1._chart.valueAxes[i].gridAlpha = yAxis.axisGridAlpha(); | ||
this_1._chart.valueAxes[i].dashLength = yAxis.axisDashLength(); | ||
this_1._chart.valueAxes[i].boldPeriodBeginning = yAxis.axisBoldPeriodBeginning(); | ||
this_1._chart.valueAxes[i].autoGridCount = yAxis.axisAutoGridCount(); | ||
switch (yAxis.axisType()) { | ||
CommonSerial.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.type = "serial"; | ||
this._chart.startDuration = this.startDuration(); | ||
this._chart.rotate = this.orientation() === "vertical"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.categoryAxis = {}; | ||
// this._chart.titles = []; | ||
var xAxis = this.xAxes()[0]; | ||
// xAxis.type("x"); | ||
this._chart.categoryAxis.position = xAxis.position() ? xAxis.position() : "bottom"; | ||
this._chart.categoryAxis.autoGridCount = xAxis.axisAutoGridCount(); | ||
this._chart.categoryAxis.gridPosition = xAxis.axisGridPosition(); | ||
this._chart.categoryAxis.axisAlpha = xAxis.axisAlpha(); | ||
this._chart.categoryAxis.gridAlpha = xAxis.axisGridAlpha(); | ||
this._chart.categoryAxis.startOnAxis = xAxis.startOnAxis(); | ||
this._chart.categoryAxis.labelRotation = xAxis.axisLabelRotation(); | ||
this._chart.categoryAxis.title = xAxis.axisTitle(); | ||
this._chart.categoryAxis.axisColor = xAxis.axisBaselineColor(); | ||
this._chart.categoryAxis.axisThickness = xAxis.axisLineWidth(); | ||
this._chart.categoryAxis.boldPeriodBeginning = xAxis.axisBoldPeriodBeginning(); | ||
this._chart.categoryAxis.dashLength = xAxis.axisDashLength(); | ||
this._chart.categoryAxis.fillAlpha = xAxis.axisFillAlpha(); | ||
this._chart.categoryAxis.fillColor = xAxis.axisFillColor(); | ||
this._chart.categoryAxis.fontSize = xAxis.axisFontSize(); | ||
this._chart.categoryAxis.color = xAxis.axisFontColor(); | ||
this._chart.categoryAxis.titleColor = xAxis.axisTitleFontColor(); | ||
this._chart.categoryAxis.titleFontSize = xAxis.axisTitleFontSize(); | ||
this._chart.categoryAxis.showFirstLabel = this.showFirstLabel(); | ||
this._chart.categoryAxis.showLastLabel = this.showLastLabel(); | ||
this._chart.categoryAxis.equalSpacing = this.equalSpacing(); | ||
switch (xAxis.axisType()) { | ||
case "time": | ||
this_1._chart.valueAxes[i].type = "date"; | ||
this_1._chart.valueAxes[i].parseDates = true; | ||
this_1._chart.valueAxes[i].minPeriod = this_1.axisMinPeriod() ? this_1.axisMinPeriod() : undefined; | ||
this_1._chart.valueAxes[i].logarithmic = false; | ||
if (yAxis.axisTickFormat()) { | ||
this_1.valueFormatter = d3_time_format_1.timeFormat(yAxis.axisTickFormat()); | ||
this._chart.categoryAxis.parseDates = true; | ||
this._chart.categoryAxis.minPeriod = this.axisMinPeriod() ? this.axisMinPeriod() : undefined; | ||
this._chart.categoryAxis.logarithmic = false; | ||
if (xAxis.axisTickFormat()) { | ||
this.dataFormatter = d3_time_format_1.timeFormat(xAxis.axisTickFormat()); | ||
} | ||
else if (yAxis.axisTypeTimePattern()) { | ||
this_1.valueFormatter = d3_time_format_1.timeFormat(yAxis.axisTypeTimePattern()); | ||
else if (xAxis.axisTypeTimePattern()) { | ||
this.dataFormatter = d3_time_format_1.timeFormat(xAxis.axisTypeTimePattern()); | ||
} | ||
else { | ||
this_1.valueFormatter = function (v) { return v; }; | ||
this.dataFormatter = function (v) { return v; }; | ||
} | ||
break; | ||
case "log": | ||
this_1._chart.valueAxes[i].parseDates = false; | ||
this_1._chart.valueAxes[i].logarithmic = true; | ||
this_1._chart.valueAxes[i].type = "numeric"; | ||
this_1.valueFormatter = yAxis.axisTickFormat() ? d3_format_1.format(yAxis.axisTickFormat()) : function (v) { return v; }; | ||
this._chart.categoryAxis.parseDates = false; | ||
this._chart.categoryAxis.logarithmic = true; | ||
this.dataFormatter = xAxis.axisTickFormat() ? d3_format_1.format(xAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
@@ -255,362 +204,423 @@ case "linear": | ||
default: | ||
this_1._chart.valueAxes[i].parseDates = false; | ||
this_1._chart.valueAxes[i].type = "numeric"; | ||
this_1._chart.valueAxes[i].logarithmic = false; | ||
this_1.valueFormatter = yAxis.axisTickFormat() ? d3_format_1.format(yAxis.axisTickFormat()) : function (v) { return v; }; | ||
this._chart.categoryAxis.parseDates = false; | ||
this._chart.categoryAxis.logarithmic = false; | ||
this.dataFormatter = xAxis.axisTickFormat() ? d3_format_1.format(xAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
} | ||
this_1._chart.valueAxes[i].labelFunction = function (v1, v2, v3) { | ||
switch (yAxis.axisType()) { | ||
this._chart.categoryAxis.labelFunction = function (v1, v2, v3) { | ||
switch (xAxis.axisType()) { | ||
case "time": | ||
return context.valueFormatter(yAxis.axisTickFormat() || yAxis.axisTypeTimePattern() ? new Date(v2) : v2); | ||
return context.dataFormatter(xAxis.axisTickFormat() || xAxis.axisTypeTimePattern() ? new Date(v2) : v2); | ||
default: | ||
return context.valueFormatter(v1); | ||
return context.dataFormatter(v1); | ||
} | ||
}; | ||
}; | ||
var this_1 = this; | ||
for (var i = 0; i < this.yAxes().length; i++) { | ||
_loop_1(i); | ||
} | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
if (this.showCursor()) { | ||
this._chart.chartCursor.enabled = true; | ||
this._chart.chartCursor.valueLineEnabled = true; | ||
this._chart.chartCursor.valueLineBalloonEnabled = true; | ||
this._chart.chartCursor.categoryBalloonEnabled = true; | ||
} | ||
else { | ||
this._chart.chartCursor.enabled = false; | ||
this._chart.chartCursor.valueLineEnabled = false; | ||
this._chart.chartCursor.valueLineBalloonEnabled = false; | ||
this._chart.chartCursor.categoryBalloonEnabled = false; | ||
} | ||
this._currXAxisTypes = this.xAxes().map(function (axe) { return axe.axisType(); }).toString(); | ||
this._currYAxisTypes = this.yAxes().map(function (axe) { return axe.axisType(); }).toString(); | ||
this._currXAxisTypeTimePatterns = this.xAxes().map(function (axe) { return axe.axisTypeTimePattern(); }).toString(); | ||
this._currYAxisTypeTimePatterns = this.yAxes().map(function (axe) { return axe.axisTypeTimePattern(); }).toString(); | ||
if (this._dataUpdated > this._prevDataUpdated || this._prevYAxisType !== this._currYAxisTypes || | ||
this._prevXAxisType !== this._currXAxisTypes || this._prevXAxisTypeTimePattern !== this._currXAxisTypeTimePatterns || | ||
this._prevYAxisTypeTimePattern !== this._currYAxisTypeTimePatterns || (this.paletteGrouping && this._prevPaletteGrouping !== this.paletteGrouping()) || | ||
this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.amFormatData(this.data()); | ||
} | ||
this._chart.dataProvider = this.amFormatData(this.data()); | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._prevXAxisTypes = this._currXAxisTypes; | ||
this._prevYAxisTypes = this._currYAxisTypes; | ||
this._prevXAxisTypeTimePatterns = this._currXAxisTypeTimePatterns; | ||
this._prevYAxisTypeTimePatterns = this._currXAxisTypeTimePatterns; | ||
if (this.paletteGrouping) { | ||
this._prevPaletteGrouping = this.paletteGrouping(); | ||
} | ||
this.amFormatColumns(); | ||
if (xAxis.axisAutoGridCount() === false && this.xAxisShowAllLabels()) { | ||
this._chart.categoryAxis.gridCount = this._chart.dataProvider.length; | ||
} | ||
var color; | ||
var cType; | ||
this._chart.colors = []; | ||
if (context._class.indexOf("amchart_Area") !== -1) { | ||
cType = "Area"; | ||
} | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context.columns().filter(function (d, i2) { return i2 > 0; }).forEach(function (col, idx) { | ||
if (context.paletteGrouping() === "By Category") { | ||
color = context._palette(i); | ||
var _loop_1 = function (i) { | ||
var yAxis = this_1.yAxes()[i]; | ||
// yAxis.type("y"); | ||
if (!this_1._chart.valueAxes[i]) { | ||
this_1._chart.valueAxes.push(new AmCharts.ValueAxis()); | ||
} | ||
else { | ||
color = context._palette(col); | ||
this_1._chart.valueAxes[i].id = "v" + i; | ||
this_1._chart.valueAxes[i].position = yAxis.position() ? yAxis.position() : "left"; | ||
this_1._chart.valueAxes[i].title = yAxis.axisTitle(); | ||
this_1._chart.valueAxes[i].titleColor = yAxis.axisTitleFontColor(); | ||
this_1._chart.valueAxes[i].titleFontSize = yAxis.axisTitleFontSize(); | ||
this_1._chart.valueAxes[i].axisThickness = yAxis.axisLineWidth(); | ||
this_1._chart.valueAxes[i].color = yAxis.axisFontColor(); | ||
this_1._chart.valueAxes[i].fontSize = yAxis.axisFontSize(); | ||
this_1._chart.valueAxes[i].axisColor = yAxis.axisBaselineColor(); | ||
this_1._chart.valueAxes[i].axisAlpha = yAxis.axisAlpha(); | ||
this_1._chart.valueAxes[i].fillColor = yAxis.axisFillColor(); | ||
this_1._chart.valueAxes[i].fillAlpha = yAxis.axisFillAlpha(); | ||
this_1._chart.valueAxes[i].gridAlpha = yAxis.axisGridAlpha(); | ||
this_1._chart.valueAxes[i].dashLength = yAxis.axisDashLength(); | ||
this_1._chart.valueAxes[i].boldPeriodBeginning = yAxis.axisBoldPeriodBeginning(); | ||
this_1._chart.valueAxes[i].autoGridCount = yAxis.axisAutoGridCount(); | ||
switch (yAxis.axisType()) { | ||
case "time": | ||
this_1._chart.valueAxes[i].type = "date"; | ||
this_1._chart.valueAxes[i].parseDates = true; | ||
this_1._chart.valueAxes[i].minPeriod = this_1.axisMinPeriod() ? this_1.axisMinPeriod() : undefined; | ||
this_1._chart.valueAxes[i].logarithmic = false; | ||
if (yAxis.axisTickFormat()) { | ||
this_1.valueFormatter = d3_time_format_1.timeFormat(yAxis.axisTickFormat()); | ||
} | ||
else if (yAxis.axisTypeTimePattern()) { | ||
this_1.valueFormatter = d3_time_format_1.timeFormat(yAxis.axisTypeTimePattern()); | ||
} | ||
else { | ||
this_1.valueFormatter = function (v) { return v; }; | ||
} | ||
break; | ||
case "log": | ||
this_1._chart.valueAxes[i].parseDates = false; | ||
this_1._chart.valueAxes[i].logarithmic = true; | ||
this_1._chart.valueAxes[i].type = "numeric"; | ||
this_1.valueFormatter = yAxis.axisTickFormat() ? d3_format_1.format(yAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
case "linear": | ||
/* falls through */ | ||
default: | ||
this_1._chart.valueAxes[i].parseDates = false; | ||
this_1._chart.valueAxes[i].type = "numeric"; | ||
this_1._chart.valueAxes[i].logarithmic = false; | ||
this_1.valueFormatter = yAxis.axisTickFormat() ? d3_format_1.format(yAxis.axisTickFormat()) : function (v) { return v; }; | ||
break; | ||
} | ||
context._chart.colors.push(color); // needed to work with area and line chart and all? | ||
context._chart.dataProvider[i]["color" + idx] = color; | ||
if (cType !== "Area") { | ||
context._chart.dataProvider[i]["linecolor" + idx] = context.lineColor() ? context.lineColor() : color; | ||
} | ||
if (context._colorObj[i] === undefined) { | ||
context._colorObj[i] = {}; | ||
} | ||
context._colorObj[i][idx] = { | ||
color: color, | ||
lineColor: context.lineColor() ? context.lineColor() : color | ||
this_1._chart.valueAxes[i].labelFunction = function (v1, v2, v3) { | ||
switch (yAxis.axisType()) { | ||
case "time": | ||
return context.valueFormatter(yAxis.axisTickFormat() || yAxis.axisTypeTimePattern() ? new Date(v2) : v2); | ||
default: | ||
return context.valueFormatter(v1); | ||
} | ||
}; | ||
}); | ||
}); | ||
return this._chart; | ||
}; | ||
CommonSerial.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.id = "g" + i; | ||
if (this.y2().indexOf(i) !== -1) { | ||
gObj.valueAxis = "v1"; | ||
} | ||
else { | ||
gObj.valueAxis = "v0"; | ||
} | ||
gObj.balloonFunction = function (d) { | ||
// var balloonText = d.category + ", " + context.columns()[d.graph.columnIndex+1] + ": " + context.data()[d.index][d.graph.columnIndex+1]; | ||
if (d.graph.type === "line") { | ||
return d.category + ", " + context.columns()[d.graph.index + 1] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.columnIndex + 1]); | ||
}; | ||
var this_1 = this; | ||
for (var i = 0; i < this.yAxes().length; i++) { | ||
_loop_1(i); | ||
} | ||
else if (context && context.tooltipValueFormat) { | ||
return d.category + ", " + context.columns()[d.graph.columnIndex + 1] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.columnIndex + 1]); | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
return d.category + ", " + context.columns()[d.graph.columnIndex + 1] + ": " + context.data()[d.index][d.graph.columnIndex + 1]; | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
if (this.showCursor()) { | ||
this._chart.chartCursor.enabled = true; | ||
this._chart.chartCursor.valueLineEnabled = true; | ||
this._chart.chartCursor.valueLineBalloonEnabled = true; | ||
this._chart.chartCursor.categoryBalloonEnabled = true; | ||
} | ||
else { | ||
this._chart.chartCursor.enabled = false; | ||
this._chart.chartCursor.valueLineEnabled = false; | ||
this._chart.chartCursor.valueLineBalloonEnabled = false; | ||
this._chart.chartCursor.categoryBalloonEnabled = false; | ||
} | ||
this._currXAxisTypes = this.xAxes().map(function (axe) { return axe.axisType(); }).toString(); | ||
this._currYAxisTypes = this.yAxes().map(function (axe) { return axe.axisType(); }).toString(); | ||
this._currXAxisTypeTimePatterns = this.xAxes().map(function (axe) { return axe.axisTypeTimePattern(); }).toString(); | ||
this._currYAxisTypeTimePatterns = this.yAxes().map(function (axe) { return axe.axisTypeTimePattern(); }).toString(); | ||
if (this._dataUpdated > this._prevDataUpdated || this._prevYAxisType !== this._currYAxisTypes || | ||
this._prevXAxisType !== this._currXAxisTypes || this._prevXAxisTypeTimePattern !== this._currXAxisTypeTimePatterns || | ||
this._prevYAxisTypeTimePattern !== this._currYAxisTypeTimePatterns || (this.paletteGrouping && this._prevPaletteGrouping !== this.paletteGrouping()) || | ||
this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.amFormatData(this.data()); | ||
} | ||
this._chart.dataProvider = this.amFormatData(this.data()); | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._prevXAxisTypes = this._currXAxisTypes; | ||
this._prevYAxisTypes = this._currYAxisTypes; | ||
this._prevXAxisTypeTimePatterns = this._currXAxisTypeTimePatterns; | ||
this._prevYAxisTypeTimePatterns = this._currXAxisTypeTimePatterns; | ||
if (this.paletteGrouping) { | ||
this._prevPaletteGrouping = this.paletteGrouping(); | ||
} | ||
this.amFormatColumns(); | ||
if (xAxis.axisAutoGridCount() === false && this.xAxisShowAllLabels()) { | ||
this._chart.categoryAxis.gridCount = this._chart.dataProvider.length; | ||
} | ||
var color; | ||
var cType; | ||
this._chart.colors = []; | ||
if (context._class.indexOf("amchart_Area") !== -1) { | ||
cType = "Area"; | ||
} | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context.columns().filter(function (d, i2) { return i2 > 0; }).forEach(function (col, idx) { | ||
if (context.paletteGrouping() === "By Category") { | ||
color = context._palette(i); | ||
} | ||
else { | ||
color = context._palette(col); | ||
} | ||
context._chart.colors.push(color); // needed to work with area and line chart and all? | ||
context._chart.dataProvider[i]["color" + idx] = color; | ||
if (cType !== "Area") { | ||
context._chart.dataProvider[i]["linecolor" + idx] = context.lineColor() ? context.lineColor() : color; | ||
} | ||
if (context._colorObj[i] === undefined) { | ||
context._colorObj[i] = {}; | ||
} | ||
context._colorObj[i][idx] = { | ||
color: color, | ||
lineColor: context.lineColor() ? context.lineColor() : color | ||
}; | ||
}); | ||
}); | ||
return this._chart; | ||
}; | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineColor = context.lineColor(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.type = gType; | ||
gObj.title = ""; | ||
var fieldArr = ["value", "open", "close", "high", "low"]; | ||
fieldArr.forEach(function (field) { | ||
if (typeof (context["_" + field + "Field"]) !== "undefined" && typeof (context["_" + field + "Field"][i]) !== "undefined") { | ||
gObj[field + "Field"] = context["_" + field + "Field"][i]; | ||
CommonSerial.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.id = "g" + i; | ||
if (this.y2().indexOf(i) !== -1) { | ||
gObj.valueAxis = "v1"; | ||
} | ||
}); | ||
try { | ||
if (context.useImgPatterns()) { | ||
var patternArr = JSON.parse(context.imgPatternArr()); | ||
if (typeof (patternArr[i]) !== "undefined") { | ||
gObj.pattern = patternArr[i]; | ||
else { | ||
gObj.valueAxis = "v0"; | ||
} | ||
gObj.balloonFunction = function (d) { | ||
// var balloonText = d.category + ", " + context.columns()[d.graph.columnIndex+1] + ": " + context.data()[d.index][d.graph.columnIndex+1]; | ||
if (d.graph.type === "line") { | ||
return d.category + ", " + context.columns()[d.graph.index + 1] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.columnIndex + 1]); | ||
} | ||
else if (context && context.tooltipValueFormat) { | ||
return d.category + ", " + context.columns()[d.graph.columnIndex + 1] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.columnIndex + 1]); | ||
} | ||
else { | ||
return d.category + ", " + context.columns()[d.graph.columnIndex + 1] + ": " + context.data()[d.index][d.graph.columnIndex + 1]; | ||
} | ||
}; | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineColor = context.lineColor(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.type = gType; | ||
gObj.title = ""; | ||
var fieldArr = ["value", "open", "close", "high", "low"]; | ||
fieldArr.forEach(function (field) { | ||
if (typeof (context["_" + field + "Field"]) !== "undefined" && typeof (context["_" + field + "Field"][i]) !== "undefined") { | ||
gObj[field + "Field"] = context["_" + field + "Field"][i]; | ||
} | ||
}); | ||
try { | ||
if (context.useImgPatterns()) { | ||
var patternArr = JSON.parse(context.imgPatternArr()); | ||
if (typeof (patternArr[i]) !== "undefined") { | ||
gObj.pattern = patternArr[i]; | ||
} | ||
} | ||
else { | ||
gObj.pattern = ""; | ||
} | ||
} | ||
else { | ||
gObj.pattern = ""; | ||
catch (e) { | ||
console.log("e:"); | ||
console.log(e); | ||
} | ||
} | ||
catch (e) { | ||
console.log("e:"); | ||
console.log(e); | ||
} | ||
gObj.colorField = "color" + i; | ||
gObj.lineColorField = "linecolor" + i; | ||
gObj.fillColorsField = "fillcolor" + i; | ||
return gObj; | ||
}; | ||
CommonSerial.prototype.amFormatColumns = function () { | ||
this._categoryField = this.columns()[0]; | ||
this._chart.categoryField = this.columns()[0]; | ||
this._openField = []; | ||
this._closeField = []; | ||
this._valueField = this.columns().slice(1); | ||
return this; | ||
}; | ||
CommonSerial.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
if (this.xAxes().length === 0) { | ||
this.xAxes().push(this._xAxis); | ||
} | ||
if (this.yAxes().length === 0) { | ||
this.yAxes().push(this._yAxis); | ||
} | ||
if (this.y2().length && this.yAxes().length === 1) { | ||
var y2Axis = new SerialAxis_1.SerialAxis(); | ||
y2Axis.owningWidget = this; | ||
this.yAxes().push(y2Axis); | ||
} | ||
var context = this; | ||
var initObj = { | ||
type: "serial", | ||
addClassNames: true, | ||
chartScrollbar: {}, | ||
chartCursor: { | ||
enabled: false, | ||
valueLineEnabled: false, | ||
valueLineBalloonEnabled: false, | ||
categoryBalloonEnabled: false, | ||
cursorAlpha: 0, | ||
valueLineAlpha: 0.2, | ||
oneBalloonOnly: true, | ||
balloonPointerOrientation: "vertical", | ||
valueBalloonsEnabled: false // always set false | ||
} | ||
gObj.colorField = "color" + i; | ||
gObj.lineColorField = "linecolor" + i; | ||
gObj.fillColorsField = "fillcolor" + i; | ||
return gObj; | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field; | ||
var field2; | ||
if (context._gType === "column") { | ||
field = graph.fillColorsField; | ||
field2 = graph.lineColorField; | ||
CommonSerial.prototype.amFormatColumns = function () { | ||
this._categoryField = this.columns()[0]; | ||
this._chart.categoryField = this.columns()[0]; | ||
this._openField = []; | ||
this._closeField = []; | ||
this._valueField = this.columns().slice(1); | ||
return this; | ||
}; | ||
CommonSerial.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
if (this.xAxes().length === 0) { | ||
this.xAxes().push(this._xAxis); | ||
} | ||
else if (context._gType === "line") { | ||
field = graph.colorField; | ||
if (this.yAxes().length === 0) { | ||
this.yAxes().push(this._yAxis); | ||
} | ||
else if (context._gType === "area") { | ||
field = graph.colorField; | ||
if (this.y2().length && this.yAxes().length === 1) { | ||
var y2Axis = new SerialAxis_1.SerialAxis(); | ||
y2Axis.owningWidget = this; | ||
this.yAxes().push(y2Axis); | ||
} | ||
if (field) { | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
data[field2] = context._colorObj[e.index][e.target.columnIndex].lineColor; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
context._selected.data[context._selected.field2] = context._colorObj[context._selected.dIdx][context._selected.cIdx].lineColor; | ||
var context = this; | ||
var initObj = { | ||
type: "serial", | ||
addClassNames: true, | ||
chartScrollbar: {}, | ||
chartCursor: { | ||
enabled: false, | ||
valueLineEnabled: false, | ||
valueLineBalloonEnabled: false, | ||
categoryBalloonEnabled: false, | ||
cursorAlpha: 0, | ||
valueLineAlpha: 0.2, | ||
oneBalloonOnly: true, | ||
balloonPointerOrientation: "vertical", | ||
valueBalloonsEnabled: false // always set false | ||
} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field; | ||
var field2; | ||
if (context._gType === "column") { | ||
field = graph.fillColorsField; | ||
field2 = graph.lineColorField; | ||
} | ||
else if (context._gType === "line") { | ||
field = graph.colorField; | ||
} | ||
else if (context._gType === "area") { | ||
field = graph.colorField; | ||
} | ||
if (field) { | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
data[field2] = context._colorObj[e.index][e.target.columnIndex].lineColor; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
context._selected.data[context._selected.field2] = context._colorObj[context._selected.dIdx][context._selected.cIdx].lineColor; | ||
} | ||
} | ||
} | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
data[field2] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
context._selected.data[context._selected.field2] = context._colorObj[context._selected.dIdx][context._selected.cIdx].lineColor; | ||
else { | ||
data[field] = context.selectionColor(); | ||
data[field2] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
context._selected.data[context._selected.field2] = context._colorObj[context._selected.dIdx][context._selected.cIdx].lineColor; | ||
} | ||
context._selected = { | ||
field: field, | ||
field2: field2, | ||
data: data, | ||
dIdx: e.index, | ||
cIdx: e.target.columnIndex | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
context._selected = { | ||
field: field, | ||
field2: field2, | ||
data: data, | ||
dIdx: e.index, | ||
cIdx: e.target.columnIndex | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
e.chart.validateData(); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.columnIndex + 1], context._selected !== null); | ||
}); | ||
}; | ||
CommonSerial.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
var context = this; | ||
// assign correct axe to PPs and correct context to PropertyExt Obj | ||
this.yAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._yAxis = axe; | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
this.xAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._xAxis = axe; | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
if (this.backwardsCompatible()) { | ||
this.switchProperties(true); | ||
} | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.columnIndex + 1], context._selected !== null); | ||
}); | ||
}; | ||
CommonSerial.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
var context = this; | ||
// assign correct axe to PPs and correct context to PropertyExt Obj | ||
this.yAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._yAxis = axe; | ||
else { | ||
this.switchProperties(false); | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
this.xAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._xAxis = axe; | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
if (this.backwardsCompatible()) { | ||
this.switchProperties(true); | ||
} | ||
else { | ||
this.switchProperties(false); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
}; | ||
CommonSerial.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonSerial.prototype.data = function (_) { | ||
}; | ||
CommonSerial.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonSerial.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
CommonSerial.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonSerial; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonSerial = CommonSerial; | ||
CommonSerial.prototype._class += " amchart_CommonSerial"; | ||
CommonSerial.prototype.implements(api_1.ITooltip.prototype); | ||
CommonSerial.prototype.publish("backwardsCompatible", true, "boolean", "Allow use of old publish parameters"); | ||
CommonSerial.prototype.publish("xAxes", [], "propertyArray", "xAxis", null, { max: 1, tags: ["Basic"] }); // max number of xAxes | ||
CommonSerial.prototype.publish("yAxes", [], "propertyArray", "yAxis", null, { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonSerial.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineWidth", 1, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineColor", null, "html-color", "Color of the data/content lines", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineOpacity", 1, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("dashedLineStyle", 0, "number", "Length of Dashed Line. 0 = none", null, { tags: ["Advanced", "Shared"] }); | ||
CommonSerial.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("showScrollbar", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("orientation", "horizontal", "set", "Orientation", ["horizontal", "vertical"], { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonSerial.prototype.publish("useImgPatterns", false, "boolean", "Enable Image Pattern backgrounds", null, { tags: ["Private"] }); | ||
CommonSerial.prototype.publish("imgPatternArr", '["../ampatterns/black/pattern2.png"]', "string", "Background Pattern Images (Not used if '[]')", null, { inputType: "textarea", tags: ["Private"] }); | ||
CommonSerial.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("axisMinPeriod", "MM", "string", "Minimum period when parsing dates"); | ||
// CommonSerial.prototype.publish("balloonType", "amchart", "set", "Balloon Type", ["hpcc", "amchart"]); TODO | ||
CommonSerial.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("showCursor", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("showFirstLabel", true, "boolean", "Show first label", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("showLastLabel", true, "boolean", "Show last label", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("equalSpacing", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("paletteGrouping", "By Column", "set", "Palette Grouping", ["By Category", "By Column"], { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("y2", [], "array", "Columns to associate with second Y-Axis"); | ||
CommonSerial.prototype.publish("axisLineWidth", 1, "number", "Axis Line Width", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("axisAlpha", 1, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); // share? | ||
CommonSerial.prototype.publish("startOnAxis", true, "boolean", "Draw Chart Starting On Axis.", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("xAxisShowAllLabels", false, "boolean", "show All Category Axis Labels", null, { tags: ["Intermediate"] }); | ||
// proxy | ||
CommonSerial.prototype.publish("axisFontSize", null, "number", "X/Y Axis Text Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publishProxy("xAxisBaselineColor", "_xAxis", "axisBaselineColor"); | ||
CommonSerial.prototype.publishProxy("yAxisBaselineColor", "_yAxis", "axisBaselineColor"); | ||
CommonSerial.prototype.publishProxy("xAxisFontColor", "_xAxis", "axisFontColor"); | ||
CommonSerial.prototype.publishProxy("yAxisFontColor", "_yAxis", "axisFontColor"); | ||
CommonSerial.prototype.publishProxy("xAxisTitle", "_xAxis", "axisTitle"); | ||
CommonSerial.prototype.publishProxy("yAxisTitle", "_yAxis", "axisTitle"); | ||
CommonSerial.prototype.publishProxy("xAxisTitleFontSize", "_xAxis", "axisTitleFontSize"); | ||
CommonSerial.prototype.publishProxy("yAxisTitleFontSize", "_yAxis", "axisTitleFontSize"); | ||
CommonSerial.prototype.publishProxy("xAxisTitleFontColor", "_xAxis", "axisTitleFontColor"); | ||
CommonSerial.prototype.publishProxy("yAxisTitleFontColor", "_yAxis", "axisTitleFontColor"); | ||
CommonSerial.prototype.publishProxy("xAxisLabelRotation", "_xAxis", "axisLabelRotation"); | ||
CommonSerial.prototype.publishProxy("yAxisLabelRotation", "_yAxis", "axisLabelRotation"); | ||
CommonSerial.prototype.publishProxy("xAxisAutoGridCount", "_xAxis", "axisAutoGridCount"); | ||
CommonSerial.prototype.publishProxy("yAxisAutoGridCount", "_yAxis", "axisAutoGridCount"); // need to add? | ||
CommonSerial.prototype.publishProxy("xAxisGridPosition", "_xAxis", "axisGridPosition"); | ||
CommonSerial.prototype.publishProxy("xAxisBoldPeriodBeginning", "_xAxis", "axisBoldPeriodBeginning"); | ||
CommonSerial.prototype.publishProxy("yAxisBoldPeriodBeginning", "_yAxis", "axisBoldPeriodBeginning"); | ||
CommonSerial.prototype.publishProxy("xAxisDashLength", "_xAxis", "axisDashLength"); | ||
CommonSerial.prototype.publishProxy("yAxisDashLength", "_yAxis", "axisDashLength"); | ||
CommonSerial.prototype.publishProxy("xAxisFillAlpha", "_xAxis", "axisFillAlpha"); | ||
CommonSerial.prototype.publishProxy("yAxisFillAlpha", "_yAxis", "axisFillAlpha"); | ||
CommonSerial.prototype.publishProxy("xAxisFillColor", "_xAxis", "axisFillColor"); | ||
CommonSerial.prototype.publishProxy("yAxisFillColor", "_yAxis", "axisFillColor"); | ||
CommonSerial.prototype.publishProxy("xAxisGridAlpha", "_xAxis", "axisGridAlpha"); | ||
CommonSerial.prototype.publishProxy("yAxisGridAlpha", "_yAxis", "axisGridAlpha"); | ||
CommonSerial.prototype.publishProxy("xAxisTypeTimePattern", "_xAxis", "axisTypeTimePattern"); | ||
CommonSerial.prototype.publishProxy("yAxisTypeTimePattern", "_yAxis", "axisTypeTimePattern"); | ||
CommonSerial.prototype.publishProxy("xAxisType", "_xAxis", "axisType"); | ||
CommonSerial.prototype.publishProxy("yAxisType", "_yAxis", "axisType"); | ||
CommonSerial.prototype.publishProxy("xAxisTickFormat", "_xAxis", "axisTickFormat"); | ||
CommonSerial.prototype.publishProxy("yAxisTickFormat", "_yAxis", "axisTickFormat"); | ||
var _origBackwardsCompatible = CommonSerial.prototype.backwardsCompatible; | ||
CommonSerial.prototype.backwardsCompatible = function (_) { | ||
var retVal = _origBackwardsCompatible.apply(this, arguments); | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
this.switchProperties(_); | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
return retVal; | ||
}; | ||
CommonSerial.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonSerial; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonSerial = CommonSerial; | ||
CommonSerial.prototype._class += " amchart_CommonSerial"; | ||
CommonSerial.prototype.implements(api_1.ITooltip.prototype); | ||
CommonSerial.prototype.publish("backwardsCompatible", true, "boolean", "Allow use of old publish parameters"); | ||
CommonSerial.prototype.publish("xAxes", [], "propertyArray", "xAxis", null, { max: 1, tags: ["Basic"] }); // max number of xAxes | ||
CommonSerial.prototype.publish("yAxes", [], "propertyArray", "yAxis", null, { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonSerial.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineWidth", 1, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineColor", null, "html-color", "Color of the data/content lines", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("lineOpacity", 1, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publish("dashedLineStyle", 0, "number", "Length of Dashed Line. 0 = none", null, { tags: ["Advanced", "Shared"] }); | ||
CommonSerial.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("showScrollbar", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("orientation", "horizontal", "set", "Orientation", ["horizontal", "vertical"], { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("startDuration", 0.3, "number", "Start Duration (sec)", null, { tags: ["Private"] }); | ||
CommonSerial.prototype.publish("useImgPatterns", false, "boolean", "Enable Image Pattern backgrounds", null, { tags: ["Private"] }); | ||
CommonSerial.prototype.publish("imgPatternArr", '["../ampatterns/black/pattern2.png"]', "string", "Background Pattern Images (Not used if '[]')", null, { inputType: "textarea", tags: ["Private"] }); | ||
CommonSerial.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("axisMinPeriod", "MM", "string", "Minimum period when parsing dates"); | ||
// CommonSerial.prototype.publish("balloonType", "amchart", "set", "Balloon Type", ["hpcc", "amchart"]); TODO | ||
CommonSerial.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("showCursor", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("showFirstLabel", true, "boolean", "Show first label", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("showLastLabel", true, "boolean", "Show last label", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("equalSpacing", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("paletteGrouping", "By Column", "set", "Palette Grouping", ["By Category", "By Column"], { tags: ["Basic"] }); | ||
CommonSerial.prototype.publish("y2", [], "array", "Columns to associate with second Y-Axis"); | ||
CommonSerial.prototype.publish("axisLineWidth", 1, "number", "Axis Line Width", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonSerial.prototype.publish("axisAlpha", 1, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); // share? | ||
CommonSerial.prototype.publish("startOnAxis", true, "boolean", "Draw Chart Starting On Axis.", null, { tags: ["Intermediate"] }); | ||
CommonSerial.prototype.publish("xAxisShowAllLabels", false, "boolean", "show All Category Axis Labels", null, { tags: ["Intermediate"] }); | ||
// proxy | ||
CommonSerial.prototype.publish("axisFontSize", null, "number", "X/Y Axis Text Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonSerial.prototype.publishProxy("xAxisBaselineColor", "_xAxis", "axisBaselineColor"); | ||
CommonSerial.prototype.publishProxy("yAxisBaselineColor", "_yAxis", "axisBaselineColor"); | ||
CommonSerial.prototype.publishProxy("xAxisFontColor", "_xAxis", "axisFontColor"); | ||
CommonSerial.prototype.publishProxy("yAxisFontColor", "_yAxis", "axisFontColor"); | ||
CommonSerial.prototype.publishProxy("xAxisTitle", "_xAxis", "axisTitle"); | ||
CommonSerial.prototype.publishProxy("yAxisTitle", "_yAxis", "axisTitle"); | ||
CommonSerial.prototype.publishProxy("xAxisTitleFontSize", "_xAxis", "axisTitleFontSize"); | ||
CommonSerial.prototype.publishProxy("yAxisTitleFontSize", "_yAxis", "axisTitleFontSize"); | ||
CommonSerial.prototype.publishProxy("xAxisTitleFontColor", "_xAxis", "axisTitleFontColor"); | ||
CommonSerial.prototype.publishProxy("yAxisTitleFontColor", "_yAxis", "axisTitleFontColor"); | ||
CommonSerial.prototype.publishProxy("xAxisLabelRotation", "_xAxis", "axisLabelRotation"); | ||
CommonSerial.prototype.publishProxy("yAxisLabelRotation", "_yAxis", "axisLabelRotation"); | ||
CommonSerial.prototype.publishProxy("xAxisAutoGridCount", "_xAxis", "axisAutoGridCount"); | ||
CommonSerial.prototype.publishProxy("yAxisAutoGridCount", "_yAxis", "axisAutoGridCount"); // need to add? | ||
CommonSerial.prototype.publishProxy("xAxisGridPosition", "_xAxis", "axisGridPosition"); | ||
CommonSerial.prototype.publishProxy("xAxisBoldPeriodBeginning", "_xAxis", "axisBoldPeriodBeginning"); | ||
CommonSerial.prototype.publishProxy("yAxisBoldPeriodBeginning", "_yAxis", "axisBoldPeriodBeginning"); | ||
CommonSerial.prototype.publishProxy("xAxisDashLength", "_xAxis", "axisDashLength"); | ||
CommonSerial.prototype.publishProxy("yAxisDashLength", "_yAxis", "axisDashLength"); | ||
CommonSerial.prototype.publishProxy("xAxisFillAlpha", "_xAxis", "axisFillAlpha"); | ||
CommonSerial.prototype.publishProxy("yAxisFillAlpha", "_yAxis", "axisFillAlpha"); | ||
CommonSerial.prototype.publishProxy("xAxisFillColor", "_xAxis", "axisFillColor"); | ||
CommonSerial.prototype.publishProxy("yAxisFillColor", "_yAxis", "axisFillColor"); | ||
CommonSerial.prototype.publishProxy("xAxisGridAlpha", "_xAxis", "axisGridAlpha"); | ||
CommonSerial.prototype.publishProxy("yAxisGridAlpha", "_yAxis", "axisGridAlpha"); | ||
CommonSerial.prototype.publishProxy("xAxisTypeTimePattern", "_xAxis", "axisTypeTimePattern"); | ||
CommonSerial.prototype.publishProxy("yAxisTypeTimePattern", "_yAxis", "axisTypeTimePattern"); | ||
CommonSerial.prototype.publishProxy("xAxisType", "_xAxis", "axisType"); | ||
CommonSerial.prototype.publishProxy("yAxisType", "_yAxis", "axisType"); | ||
CommonSerial.prototype.publishProxy("xAxisTickFormat", "_xAxis", "axisTickFormat"); | ||
CommonSerial.prototype.publishProxy("yAxisTickFormat", "_yAxis", "axisTickFormat"); | ||
var _origBackwardsCompatible = CommonSerial.prototype.backwardsCompatible; | ||
CommonSerial.prototype.backwardsCompatible = function (_) { | ||
var retVal = _origBackwardsCompatible.apply(this, arguments); | ||
if (arguments.length) { | ||
this.switchProperties(_); | ||
} | ||
return retVal; | ||
}; | ||
}); | ||
//# sourceMappingURL=CommonSerial.js.map |
@@ -1,382 +0,392 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/xy"); | ||
var d3_format_1 = require("d3-format"); | ||
var XYAxis_1 = require("./XYAxis"); | ||
var AmCharts = window.AmCharts; | ||
var CommonXY = (function (_super) { | ||
tslib_1.__extends(CommonXY, _super); | ||
function CommonXY() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._xAxis = new XYAxis_1.XYAxis(); | ||
_this._yAxis = new XYAxis_1.XYAxis(); | ||
_this._tag = "div"; | ||
_this._xAxis._owningWidget = _this; | ||
_this._yAxis._owningWidget = _this; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
CommonXY.prototype.switchProperties = function (val) { | ||
if (val === true) { | ||
CommonXY.prototype.excludeObjs = ["amchart_XYAxis"]; | ||
// hide the regular ones with the exclude tags? | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/xy", "d3-format", "./XYAxis"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/xy"); | ||
var d3_format_1 = require("d3-format"); | ||
var XYAxis_1 = require("./XYAxis"); | ||
var AmCharts = window.AmCharts; | ||
var CommonXY = (function (_super) { | ||
tslib_1.__extends(CommonXY, _super); | ||
function CommonXY() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._xAxis = new XYAxis_1.XYAxis(); | ||
_this._yAxis = new XYAxis_1.XYAxis(); | ||
_this._tag = "div"; | ||
_this._xAxis._owningWidget = _this; | ||
_this._yAxis._owningWidget = _this; | ||
return _this; | ||
} | ||
else { | ||
CommonXY.prototype.excludeObjs = []; | ||
} | ||
}; | ||
CommonXY.prototype.xAxis = function (idx) { | ||
if (!this.xAxes()[idx]) { | ||
var xAxis = new XYAxis_1.XYAxis(); | ||
xAxis._owningWidget = this; | ||
this.xAxes()[idx] = xAxis; | ||
} | ||
return this.xAxes()[idx]; | ||
}; | ||
CommonXY.prototype.yAxis = function (idx) { | ||
if (!this.yAxes()[idx]) { | ||
var yAxis = new XYAxis_1.XYAxis(); | ||
yAxis._owningWidget = this; | ||
this.yAxes()[idx] = yAxis; | ||
} | ||
return this.yAxes()[idx]; | ||
}; | ||
CommonXY.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.theme = "none"; | ||
this._chart.type = "xy"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
// left vAxis must always be 0 and bottom 1 !! | ||
var vAxisCount = 0; | ||
var _loop_1 = function (iy) { | ||
var yAxis = this_1.yAxes()[iy]; | ||
this_1._chart.valueAxes[vAxisCount].position = yAxis.position() ? yAxis.position() : "left"; | ||
this_1._chart.valueAxes[vAxisCount].axisAlpha = yAxis.axisAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].title = yAxis.axisTitle(); | ||
this_1._chart.valueAxes[vAxisCount].axisThickness = yAxis.axisLineWidth(); | ||
this_1._chart.valueAxes[vAxisCount].axisColor = yAxis.axisBaselineColor(); | ||
this_1._chart.valueAxes[vAxisCount].color = yAxis.axisFontColor(); | ||
this_1._chart.valueAxes[vAxisCount].titleFontSize = yAxis.axisTitleFontSize(); | ||
this_1._chart.valueAxes[vAxisCount].titleColor = yAxis.axisTitleFontColor(); | ||
this_1._chart.valueAxes[vAxisCount].autoGridCount = yAxis.axisAutoGridCount(); | ||
this_1._chart.valueAxes[vAxisCount].gridPosition = yAxis.axisGridPosition(); | ||
this_1._chart.valueAxes[vAxisCount].fillAlpha = yAxis.axisFillAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].fillColor = yAxis.axisFillColor(); | ||
this_1._chart.valueAxes[vAxisCount].gridAlpha = yAxis.axisGridAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].dashLength = yAxis.axisDashLength(); | ||
this_1._chart.valueAxes[vAxisCount].labelFunction = function (d) { | ||
return d3_format_1.format(yAxis.axisTickFormat())(d); | ||
}; | ||
vAxisCount++; | ||
CommonXY.prototype.switchProperties = function (val) { | ||
if (val === true) { | ||
CommonXY.prototype.excludeObjs = ["amchart_XYAxis"]; | ||
// hide the regular ones with the exclude tags? | ||
} | ||
else { | ||
CommonXY.prototype.excludeObjs = []; | ||
} | ||
}; | ||
var this_1 = this; | ||
for (var iy = 0; iy < this.yAxes().length; iy++) { | ||
_loop_1(iy); | ||
} | ||
var _loop_2 = function (ix) { | ||
var xAxis = this_2.xAxes()[ix]; | ||
this_2._chart.valueAxes[vAxisCount].position = xAxis.position() ? xAxis.position() : "bottom"; | ||
this_2._chart.valueAxes[vAxisCount].axisAlpha = xAxis.axisAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].title = xAxis.axisTitle(); | ||
this_2._chart.valueAxes[vAxisCount].axisThickness = xAxis.axisLineWidth(); | ||
this_2._chart.valueAxes[vAxisCount].axisColor = xAxis.axisBaselineColor(); | ||
this_2._chart.valueAxes[vAxisCount].color = xAxis.axisFontColor(); | ||
this_2._chart.valueAxes[vAxisCount].titleFontSize = xAxis.axisTitleFontSize(); | ||
this_2._chart.valueAxes[vAxisCount].titleColor = xAxis.axisTitleFontColor(); | ||
this_2._chart.valueAxes[vAxisCount].labelRotation = xAxis.axisLabelRotation(); | ||
this_2._chart.valueAxes[vAxisCount].autoGridCount = xAxis.axisAutoGridCount(); | ||
this_2._chart.valueAxes[vAxisCount].gridPosition = xAxis.axisGridPosition(); | ||
this_2._chart.valueAxes[vAxisCount].fillAlpha = xAxis.axisFillAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].fillColor = xAxis.axisFillColor(); | ||
this_2._chart.valueAxes[vAxisCount].gridAlpha = xAxis.axisGridAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].dashLength = xAxis.axisDashLength(); | ||
if (xAxis.axisType() === "ordinal") { | ||
this_2._chart.valueAxes[vAxisCount].integersOnly = true; | ||
// this._chart.valueAxes[vAxisCount].maximum = this.data().length; // (off for now) | ||
this_2._chart.valueAxes[vAxisCount].labelFunction = function (a, b) { | ||
if (b > context.data().length) { | ||
return ""; // so the the last dots arent on the edge | ||
} | ||
return context.data().length && b > 0 ? context.data()[b - 1][0] : ""; | ||
CommonXY.prototype.xAxis = function (idx) { | ||
if (!this.xAxes()[idx]) { | ||
var xAxis = new XYAxis_1.XYAxis(); | ||
xAxis._owningWidget = this; | ||
this.xAxes()[idx] = xAxis; | ||
} | ||
return this.xAxes()[idx]; | ||
}; | ||
CommonXY.prototype.yAxis = function (idx) { | ||
if (!this.yAxes()[idx]) { | ||
var yAxis = new XYAxis_1.XYAxis(); | ||
yAxis._owningWidget = this; | ||
this.yAxes()[idx] = yAxis; | ||
} | ||
return this.yAxes()[idx]; | ||
}; | ||
CommonXY.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.theme = "none"; | ||
this._chart.type = "xy"; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
// left vAxis must always be 0 and bottom 1 !! | ||
var vAxisCount = 0; | ||
var _loop_1 = function (iy) { | ||
var yAxis = this_1.yAxes()[iy]; | ||
this_1._chart.valueAxes[vAxisCount].position = yAxis.position() ? yAxis.position() : "left"; | ||
this_1._chart.valueAxes[vAxisCount].axisAlpha = yAxis.axisAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].title = yAxis.axisTitle(); | ||
this_1._chart.valueAxes[vAxisCount].axisThickness = yAxis.axisLineWidth(); | ||
this_1._chart.valueAxes[vAxisCount].axisColor = yAxis.axisBaselineColor(); | ||
this_1._chart.valueAxes[vAxisCount].color = yAxis.axisFontColor(); | ||
this_1._chart.valueAxes[vAxisCount].titleFontSize = yAxis.axisTitleFontSize(); | ||
this_1._chart.valueAxes[vAxisCount].titleColor = yAxis.axisTitleFontColor(); | ||
this_1._chart.valueAxes[vAxisCount].autoGridCount = yAxis.axisAutoGridCount(); | ||
this_1._chart.valueAxes[vAxisCount].gridPosition = yAxis.axisGridPosition(); | ||
this_1._chart.valueAxes[vAxisCount].fillAlpha = yAxis.axisFillAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].fillColor = yAxis.axisFillColor(); | ||
this_1._chart.valueAxes[vAxisCount].gridAlpha = yAxis.axisGridAlpha(); | ||
this_1._chart.valueAxes[vAxisCount].dashLength = yAxis.axisDashLength(); | ||
this_1._chart.valueAxes[vAxisCount].labelFunction = function (d) { | ||
return d3_format_1.format(yAxis.axisTickFormat())(d); | ||
}; | ||
vAxisCount++; | ||
}; | ||
var this_1 = this; | ||
for (var iy = 0; iy < this.yAxes().length; iy++) { | ||
_loop_1(iy); | ||
} | ||
var _loop_2 = function (ix) { | ||
var xAxis = this_2.xAxes()[ix]; | ||
this_2._chart.valueAxes[vAxisCount].position = xAxis.position() ? xAxis.position() : "bottom"; | ||
this_2._chart.valueAxes[vAxisCount].axisAlpha = xAxis.axisAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].title = xAxis.axisTitle(); | ||
this_2._chart.valueAxes[vAxisCount].axisThickness = xAxis.axisLineWidth(); | ||
this_2._chart.valueAxes[vAxisCount].axisColor = xAxis.axisBaselineColor(); | ||
this_2._chart.valueAxes[vAxisCount].color = xAxis.axisFontColor(); | ||
this_2._chart.valueAxes[vAxisCount].titleFontSize = xAxis.axisTitleFontSize(); | ||
this_2._chart.valueAxes[vAxisCount].titleColor = xAxis.axisTitleFontColor(); | ||
this_2._chart.valueAxes[vAxisCount].labelRotation = xAxis.axisLabelRotation(); | ||
this_2._chart.valueAxes[vAxisCount].autoGridCount = xAxis.axisAutoGridCount(); | ||
this_2._chart.valueAxes[vAxisCount].gridPosition = xAxis.axisGridPosition(); | ||
this_2._chart.valueAxes[vAxisCount].fillAlpha = xAxis.axisFillAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].fillColor = xAxis.axisFillColor(); | ||
this_2._chart.valueAxes[vAxisCount].gridAlpha = xAxis.axisGridAlpha(); | ||
this_2._chart.valueAxes[vAxisCount].dashLength = xAxis.axisDashLength(); | ||
if (xAxis.axisType() === "ordinal") { | ||
this_2._chart.valueAxes[vAxisCount].integersOnly = true; | ||
// this._chart.valueAxes[vAxisCount].maximum = this.data().length; // (off for now) | ||
this_2._chart.valueAxes[vAxisCount].labelFunction = function (a, b) { | ||
if (b > context.data().length) { | ||
return ""; // so the the last dots arent on the edge | ||
} | ||
return context.data().length && b > 0 ? context.data()[b - 1][0] : ""; | ||
}; | ||
} | ||
else { | ||
this_2._chart.valueAxes[vAxisCount].labelFunction = function (d) { | ||
return d3_format_1.format(xAxis.axisTickFormat())(d); | ||
}; | ||
} | ||
vAxisCount++; | ||
}; | ||
var this_2 = this; | ||
for (var ix = 0; ix < this.xAxes().length; ix++) { | ||
_loop_2(ix); | ||
} | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context._chart.dataProvider[i].color = context._palette(dataPoint[context.columns()[2]]); // By Y value | ||
context._chart.dataProvider[i].linecolor = context.lineColor() !== null ? context.lineColor() : context._palette(dataPoint[context.columns()[2]]); | ||
}); | ||
this._chart.colors = []; | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this_2._chart.valueAxes[vAxisCount].labelFunction = function (d) { | ||
return d3_format_1.format(xAxis.axisTickFormat())(d); | ||
}; | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
vAxisCount++; | ||
}; | ||
var this_2 = this; | ||
for (var ix = 0; ix < this.xAxes().length; ix++) { | ||
_loop_2(ix); | ||
} | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context._chart.dataProvider[i].color = context._palette(dataPoint[context.columns()[2]]); // By Y value | ||
context._chart.dataProvider[i].linecolor = context.lineColor() !== null ? context.lineColor() : context._palette(dataPoint[context.columns()[2]]); | ||
}); | ||
this._chart.colors = []; | ||
if (this.showScrollbar()) { | ||
this._chart.chartScrollbar.enabled = true; | ||
} | ||
else { | ||
this._chart.chartScrollbar.enabled = false; | ||
} | ||
if (this.showCursor()) { | ||
this._chart.precision = this.xAxes()[0].axisType() === "ordinal" ? 1 : undefined; // so ordinal will work with labelfunction | ||
this._chart.chartCursor.enabled = true; | ||
this._chart.chartCursor.valueLineEnabled = true; | ||
this._chart.chartCursor.valueLineBalloonEnabled = true; | ||
this._chart.chartCursor.categoryBalloonEnabled = true; | ||
} | ||
else { | ||
this._chart.precision = undefined; // so ordinal will work with labelfunction | ||
this._chart.chartCursor.enabled = false; | ||
this._chart.chartCursor.valueLineEnabled = false; | ||
this._chart.chartCursor.valueLineBalloonEnabled = false; | ||
this._chart.chartCursor.categoryBalloonEnabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
CommonXY.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.id = "g" + i; | ||
gObj.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return context.columns()[d.graph.index] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.index]); | ||
if (this.showCursor()) { | ||
this._chart.precision = this.xAxes()[0].axisType() === "ordinal" ? 1 : undefined; // so ordinal will work with labelfunction | ||
this._chart.chartCursor.enabled = true; | ||
this._chart.chartCursor.valueLineEnabled = true; | ||
this._chart.chartCursor.valueLineBalloonEnabled = true; | ||
this._chart.chartCursor.categoryBalloonEnabled = true; | ||
} | ||
else { | ||
return context.columns()[d.graph.index] + ": " + context.data()[d.index][d.graph.index]; | ||
this._chart.precision = undefined; // so ordinal will work with labelfunction | ||
this._chart.chartCursor.enabled = false; | ||
this._chart.chartCursor.valueLineEnabled = false; | ||
this._chart.chartCursor.valueLineBalloonEnabled = false; | ||
this._chart.chartCursor.categoryBalloonEnabled = false; | ||
} | ||
return this._chart; | ||
}; | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.bullet = context.bulletType(); | ||
gObj.bulletSize = context.bulletSize(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineColor = context.lineColor(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.type = gType; | ||
gObj.colorField = "color" + i; | ||
gObj.lineColorField = "linecolor"; | ||
// XY Values | ||
if (this.xAxes()[0].axisType() === "ordinal") { | ||
gObj.xField = "idx"; | ||
gObj.yField = context.columns()[i]; | ||
} | ||
if (this.xAxes()[0].axisType() === "linear") { | ||
gObj.xField = context.columns()[0]; | ||
gObj.yField = context.columns()[1]; | ||
} | ||
return gObj; | ||
}; | ||
CommonXY.prototype.formatData = function (dataArr) { | ||
var context = this; | ||
var dataObjArr = []; | ||
dataArr.forEach(function (dataRow, i) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
dataObj["idx"] = i + 1; | ||
CommonXY.prototype.buildGraphObj = function (gType, i) { | ||
var context = this; | ||
var gObj = {}; | ||
gObj.id = "g" + i; | ||
gObj.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return context.columns()[d.graph.index] + ": " + d3_format_1.format(context.tooltipValueFormat())(context.data()[d.index][d.graph.index]); | ||
} | ||
else { | ||
return context.columns()[d.graph.index] + ": " + context.data()[d.index][d.graph.index]; | ||
} | ||
}; | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.bullet = context.bulletType(); | ||
gObj.bulletSize = context.bulletSize(); | ||
gObj.dashLength = context.dashedLineStyle(); // TODO: convert to css Array Prop | ||
gObj.lineAlpha = context.lineOpacity(); | ||
gObj.lineColor = context.lineColor(); | ||
gObj.lineThickness = context.lineWidth(); | ||
gObj.type = gType; | ||
gObj.colorField = "color" + i; | ||
gObj.lineColorField = "linecolor"; | ||
// XY Values | ||
if (this.xAxes()[0].axisType() === "ordinal") { | ||
gObj.xField = "idx"; | ||
gObj.yField = context.columns()[i]; | ||
} | ||
if (this.xAxes()[0].axisType() === "linear") { | ||
gObj.xField = context.columns()[0]; | ||
gObj.yField = context.columns()[1]; | ||
} | ||
return gObj; | ||
}; | ||
CommonXY.prototype.formatData = function (dataArr) { | ||
var context = this; | ||
var dataObjArr = []; | ||
dataArr.forEach(function (dataRow, i) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
dataObj["idx"] = i + 1; | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
return dataObjArr; | ||
}; | ||
CommonXY.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
if (this.xAxes().length === 0) { | ||
this.xAxes().push(this._xAxis); | ||
} | ||
if (this.yAxes().length === 0) { | ||
this.yAxes().push(this._yAxis); | ||
} | ||
var context = this; | ||
var initObj = { | ||
type: "xy", | ||
addClassNames: true, | ||
autoMargins: true, | ||
chartScrollbar: {}, | ||
valueAxes: [], | ||
chartCursor: { | ||
enabled: false, | ||
valueLineEnabled: false, | ||
valueLineBalloonEnabled: false, | ||
categoryBalloonEnabled: false, | ||
cursorAlpha: 0, | ||
valueLineAlpha: 0.2, | ||
oneBalloonOnly: true, | ||
balloonPointerOrientation: "vertical", | ||
valueBalloonsEnabled: false // always set false | ||
}, | ||
graphs: [{}], | ||
dataProvider: [{}], | ||
responsive: { | ||
enabled: true | ||
return dataObjArr; | ||
}; | ||
CommonXY.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
if (this.xAxes().length === 0) { | ||
this.xAxes().push(this._xAxis); | ||
} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field = graph.colorField; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
if (this.yAxes().length === 0) { | ||
this.yAxes().push(this._yAxis); | ||
} | ||
var context = this; | ||
var initObj = { | ||
type: "xy", | ||
addClassNames: true, | ||
autoMargins: true, | ||
chartScrollbar: {}, | ||
valueAxes: [], | ||
chartCursor: { | ||
enabled: false, | ||
valueLineEnabled: false, | ||
valueLineBalloonEnabled: false, | ||
categoryBalloonEnabled: false, | ||
cursorAlpha: 0, | ||
valueLineAlpha: 0.2, | ||
oneBalloonOnly: true, | ||
balloonPointerOrientation: "vertical", | ||
valueBalloonsEnabled: false // always set false | ||
}, | ||
graphs: [{}], | ||
dataProvider: [{}], | ||
responsive: { | ||
enabled: true | ||
} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var graph = e.graph; | ||
var data = e.item.dataContext; | ||
var field = graph.colorField; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: e.target.index, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: e.target.index, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.index], context._selected !== null); | ||
}); | ||
}; | ||
CommonXY.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
var context = this; | ||
// assign correct axe to PPs and correct context to PropertyExt Obj | ||
this.yAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._yAxis = axe; | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
this.xAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._xAxis = axe; | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
if (this.backwardsCompatible()) { | ||
this.switchProperties(true); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.index], context._selected !== null); | ||
}); | ||
}; | ||
CommonXY.prototype.update = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.update.apply(this, arguments); | ||
var context = this; | ||
// assign correct axe to PPs and correct context to PropertyExt Obj | ||
this.yAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._yAxis = axe; | ||
else { | ||
this.switchProperties(false); | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
this.xAxes().forEach(function (axe, idx) { | ||
if (idx === 0) { | ||
context._xAxis = axe; | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
axe._owningWidget = context; | ||
}); | ||
if (this.backwardsCompatible()) { | ||
this.switchProperties(true); | ||
} | ||
else { | ||
this.switchProperties(false); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
}; | ||
CommonXY.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonXY.prototype.data = function (_) { | ||
}; | ||
CommonXY.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
CommonXY.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
CommonXY.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonXY; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonXY = CommonXY; | ||
CommonXY.prototype._class += " amchart_CommonXY"; | ||
CommonXY.prototype.implements(api_1.ITooltip.prototype); | ||
CommonXY.prototype.publish("backwardsCompatible", true, "boolean", "Allow use of old publish parameters"); | ||
CommonXY.prototype.publish("xAxes", [], "propertyArray", "widgets", null, { max: 1, tags: ["Basic"] }); // max number of xAxes | ||
CommonXY.prototype.publish("yAxes", [], "propertyArray", "widgets", null, { tags: ["Basic"] }); | ||
CommonXY.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonXY.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineWidth", 0, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineColor", null, "html-color", "Color of the data/content lines", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineOpacity", 0, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("dashedLineStyle", 0, "number", "", null, { tags: ["Advanced", "Shared"] }); | ||
CommonXY.prototype.publish("showScrollbar", false, "boolean", "Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("bulletSize", 8, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginLeft", 50, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginRight", 10, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginTop", 20, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginBottom", 50, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonXY.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("showCursor", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonXY.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonXY.prototype.publishProxy("xAxisType", "_xAxis", "axisType"); | ||
CommonXY.prototype.publishProxy("yAxisType", "_yAxis", "axisType"); | ||
CommonXY.prototype.publishProxy("xAxisTitle", "_xAxis", "axisTitle"); | ||
CommonXY.prototype.publishProxy("yAxisTitle", "_yAxis", "axisTitle"); | ||
CommonXY.prototype.publishProxy("xAxisBaselineColor", "_xAxis", "axisBaselineColor"); | ||
CommonXY.prototype.publishProxy("yAxisBaselineColor", "_yAxis", "axisBaselineColor"); | ||
CommonXY.prototype.publishProxy("xAxisFontColor", "_xAxis", "axisFontColor"); | ||
CommonXY.prototype.publishProxy("yAxisFontColor", "_yAxis", "axisFontColor"); | ||
CommonXY.prototype.publishProxy("xAxisTitleFontSize", "_xAxis", "axisTitleFontSize"); | ||
CommonXY.prototype.publishProxy("yAxisTitleFontSize", "_yAxis", "axisTitleFontSize"); | ||
CommonXY.prototype.publishProxy("xAxisTitleFontColor", "_xAxis", "axisTitleFontColor"); | ||
CommonXY.prototype.publishProxy("yAxisTitleFontColor", "_yAxis", "axisTitleFontColor"); | ||
CommonXY.prototype.publishProxy("xAxisLabelRotation", "_xAxis", "axisLabelRotation"); | ||
CommonXY.prototype.publishProxy("yAxisLabelRotation", "_yAxis", "axisLabelRotation"); | ||
CommonXY.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Intermediate", "Shared"] }); // ?? | ||
CommonXY.prototype.publishProxy("xAxisAutoGridCount", "_xAxis", "axisAutoGridCount"); | ||
CommonXY.prototype.publishProxy("yAxisAutoGridCount", "_yAxis", "axisAutoGridCount"); | ||
CommonXY.prototype.publishProxy("xAxisGridPosition", "_xAxis", "axisGridPosition"); | ||
CommonXY.prototype.publishProxy("yAxisGridPosition", "_yAxis", "axisGridPosition"); | ||
CommonXY.prototype.publishProxy("xAxisFillAlpha", "_xAxis", "axisFillAlpha"); | ||
CommonXY.prototype.publishProxy("yAxisFillAlpha", "_yAxis", "axisFillAlpha"); | ||
CommonXY.prototype.publishProxy("xAxisFillColor", "_xAxis", "axisFillColor"); | ||
CommonXY.prototype.publishProxy("yAxisFillColor", "_yAxis", "axisFillColor"); | ||
CommonXY.prototype.publishProxy("xAxisGridAlpha", "_xAxis", "axisGridAlpha"); | ||
CommonXY.prototype.publishProxy("yAxisGridAlpha", "_yAxis", "axisGridAlpha"); | ||
CommonXY.prototype.publishProxy("xAxisDashLength", "_xAxis", "axisDashLength"); | ||
CommonXY.prototype.publishProxy("yAxisDashLength", "_yAxis", "axisDashLength"); | ||
// CommonXY.prototype.publish("yAxisMinimum", null, "number", "",null,{tags:["Intermediate"]}); | ||
CommonXY.prototype.publishProxy("xAxisTickFormat", "_xAxis", "axisTickFormat"); | ||
CommonXY.prototype.publishProxy("yAxisTickFormat", "_yAxis", "axisTickFormat"); | ||
CommonXY.prototype.publish("axisAlpha", 1, "number", "Axis opacity", null, { tags: ["Intermediate"] }); // need to covnert to axis alpha this need to be publish proxied? | ||
var _origBackwardsCompatible = CommonXY.prototype.backwardsCompatible; | ||
CommonXY.prototype.backwardsCompatible = function (_) { | ||
var retVal = _origBackwardsCompatible.apply(this, arguments); | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
this.switchProperties(_); | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
return retVal; | ||
}; | ||
CommonXY.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return CommonXY; | ||
}(common_1.HTMLWidget)); | ||
exports.CommonXY = CommonXY; | ||
CommonXY.prototype._class += " amchart_CommonXY"; | ||
CommonXY.prototype.implements(api_1.ITooltip.prototype); | ||
CommonXY.prototype.publish("backwardsCompatible", true, "boolean", "Allow use of old publish parameters"); | ||
CommonXY.prototype.publish("xAxes", [], "propertyArray", "widgets", null, { max: 1, tags: ["Basic"] }); // max number of xAxes | ||
CommonXY.prototype.publish("yAxes", [], "propertyArray", "widgets", null, { tags: ["Basic"] }); | ||
CommonXY.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
CommonXY.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineWidth", 0, "number", "Line Thickness", null, { min: 0, max: 10, step: 1, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineColor", null, "html-color", "Color of the data/content lines", null, { tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("lineOpacity", 0, "number", "Line Opacity", null, { min: 0, max: 1, step: 0.001, inputType: "range", tags: ["Basic", "Shared"] }); | ||
CommonXY.prototype.publish("dashedLineStyle", 0, "number", "", null, { tags: ["Advanced", "Shared"] }); | ||
CommonXY.prototype.publish("showScrollbar", false, "boolean", "Chart Scrollbar", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("bulletSize", 8, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginLeft", 50, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginRight", 10, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginTop", 20, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("marginBottom", 50, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
CommonXY.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
CommonXY.prototype.publish("showCursor", false, "boolean", "Show Chart Scrollbar", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonXY.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
CommonXY.prototype.publishProxy("xAxisType", "_xAxis", "axisType"); | ||
CommonXY.prototype.publishProxy("yAxisType", "_yAxis", "axisType"); | ||
CommonXY.prototype.publishProxy("xAxisTitle", "_xAxis", "axisTitle"); | ||
CommonXY.prototype.publishProxy("yAxisTitle", "_yAxis", "axisTitle"); | ||
CommonXY.prototype.publishProxy("xAxisBaselineColor", "_xAxis", "axisBaselineColor"); | ||
CommonXY.prototype.publishProxy("yAxisBaselineColor", "_yAxis", "axisBaselineColor"); | ||
CommonXY.prototype.publishProxy("xAxisFontColor", "_xAxis", "axisFontColor"); | ||
CommonXY.prototype.publishProxy("yAxisFontColor", "_yAxis", "axisFontColor"); | ||
CommonXY.prototype.publishProxy("xAxisTitleFontSize", "_xAxis", "axisTitleFontSize"); | ||
CommonXY.prototype.publishProxy("yAxisTitleFontSize", "_yAxis", "axisTitleFontSize"); | ||
CommonXY.prototype.publishProxy("xAxisTitleFontColor", "_xAxis", "axisTitleFontColor"); | ||
CommonXY.prototype.publishProxy("yAxisTitleFontColor", "_yAxis", "axisTitleFontColor"); | ||
CommonXY.prototype.publishProxy("xAxisLabelRotation", "_xAxis", "axisLabelRotation"); | ||
CommonXY.prototype.publishProxy("yAxisLabelRotation", "_yAxis", "axisLabelRotation"); | ||
CommonXY.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Intermediate", "Shared"] }); // ?? | ||
CommonXY.prototype.publishProxy("xAxisAutoGridCount", "_xAxis", "axisAutoGridCount"); | ||
CommonXY.prototype.publishProxy("yAxisAutoGridCount", "_yAxis", "axisAutoGridCount"); | ||
CommonXY.prototype.publishProxy("xAxisGridPosition", "_xAxis", "axisGridPosition"); | ||
CommonXY.prototype.publishProxy("yAxisGridPosition", "_yAxis", "axisGridPosition"); | ||
CommonXY.prototype.publishProxy("xAxisFillAlpha", "_xAxis", "axisFillAlpha"); | ||
CommonXY.prototype.publishProxy("yAxisFillAlpha", "_yAxis", "axisFillAlpha"); | ||
CommonXY.prototype.publishProxy("xAxisFillColor", "_xAxis", "axisFillColor"); | ||
CommonXY.prototype.publishProxy("yAxisFillColor", "_yAxis", "axisFillColor"); | ||
CommonXY.prototype.publishProxy("xAxisGridAlpha", "_xAxis", "axisGridAlpha"); | ||
CommonXY.prototype.publishProxy("yAxisGridAlpha", "_yAxis", "axisGridAlpha"); | ||
CommonXY.prototype.publishProxy("xAxisDashLength", "_xAxis", "axisDashLength"); | ||
CommonXY.prototype.publishProxy("yAxisDashLength", "_yAxis", "axisDashLength"); | ||
// CommonXY.prototype.publish("yAxisMinimum", null, "number", "",null,{tags:["Intermediate"]}); | ||
CommonXY.prototype.publishProxy("xAxisTickFormat", "_xAxis", "axisTickFormat"); | ||
CommonXY.prototype.publishProxy("yAxisTickFormat", "_yAxis", "axisTickFormat"); | ||
CommonXY.prototype.publish("axisAlpha", 1, "number", "Axis opacity", null, { tags: ["Intermediate"] }); // need to covnert to axis alpha this need to be publish proxied? | ||
var _origBackwardsCompatible = CommonXY.prototype.backwardsCompatible; | ||
CommonXY.prototype.backwardsCompatible = function (_) { | ||
var retVal = _origBackwardsCompatible.apply(this, arguments); | ||
if (arguments.length) { | ||
this.switchProperties(_); | ||
} | ||
return retVal; | ||
}; | ||
}); | ||
//# sourceMappingURL=CommonXY.js.map |
@@ -1,43 +0,53 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var d3_format_1 = require("d3-format"); | ||
var CommonFunnel_1 = require("./CommonFunnel"); | ||
var Funnel = (function (_super) { | ||
tslib_1.__extends(Funnel, _super); | ||
function Funnel() { | ||
return _super.call(this) || this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Funnel.prototype.enter = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.enter.apply(this, arguments); | ||
}; | ||
Funnel.prototype.updateChartOptions = function () { | ||
CommonFunnel_1.CommonFunnel.prototype.updateChartOptions.apply(this, arguments); | ||
var context = this; | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ", " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
} | ||
else { | ||
return d.title + ", " + d.value; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "d3-format", "./CommonFunnel"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var d3_format_1 = require("d3-format"); | ||
var CommonFunnel_1 = require("./CommonFunnel"); | ||
var Funnel = (function (_super) { | ||
tslib_1.__extends(Funnel, _super); | ||
function Funnel() { | ||
return _super.call(this) || this; | ||
} | ||
Funnel.prototype.enter = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.enter.apply(this, arguments); | ||
}; | ||
this._chart.neckHeight = this.neckHeightPercent() + "%"; | ||
this._chart.neckWidth = this.neckWidthPercent() + "%"; | ||
}; | ||
Funnel.prototype.update = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Funnel; | ||
}(CommonFunnel_1.CommonFunnel)); | ||
exports.Funnel = Funnel; | ||
Funnel.prototype._class += " amchart_Funnel"; | ||
Funnel.prototype.implements(api_1.I2DChart.prototype); | ||
Funnel.prototype.publish("paletteID", "default", "set", "Palette ID", Funnel.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Funnel.prototype.publish("neckHeightPercent", 30, "number", "Neck Height %", null, { tags: ["Basic"] }); | ||
Funnel.prototype.publish("neckWidthPercent", 40, "number", "Neck Width %", null, { tags: ["Basic"] }); | ||
Funnel.prototype.updateChartOptions = function () { | ||
CommonFunnel_1.CommonFunnel.prototype.updateChartOptions.apply(this, arguments); | ||
var context = this; | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ", " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
} | ||
else { | ||
return d.title + ", " + d.value; | ||
} | ||
}; | ||
this._chart.neckHeight = this.neckHeightPercent() + "%"; | ||
this._chart.neckWidth = this.neckWidthPercent() + "%"; | ||
}; | ||
Funnel.prototype.update = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Funnel; | ||
}(CommonFunnel_1.CommonFunnel)); | ||
exports.Funnel = Funnel; | ||
Funnel.prototype._class += " amchart_Funnel"; | ||
Funnel.prototype.implements(api_1.I2DChart.prototype); | ||
Funnel.prototype.publish("paletteID", "default", "set", "Palette ID", Funnel.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Funnel.prototype.publish("neckHeightPercent", 30, "number", "Neck Height %", null, { tags: ["Basic"] }); | ||
Funnel.prototype.publish("neckWidthPercent", 40, "number", "Neck Width %", null, { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=Funnel.js.map |
356
lib/Gantt.js
@@ -1,188 +0,198 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/gantt"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var AmCharts = window.AmCharts; | ||
var Gantt = (function (_super) { | ||
tslib_1.__extends(Gantt, _super); | ||
function Gantt() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._dateParserData = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Gantt.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.depth3D = this.depth3D(); | ||
this._chart.angle = this.angle3D(); | ||
if (this._dataUpdated > this._prevDataUpdated || this._prevTimePattern !== this.timePattern()) { | ||
this._chart.dataProvider = []; | ||
var data = this.amFormattedData(); | ||
var _loop_1 = function (key) { | ||
var obj = {}; | ||
obj.category = key; | ||
obj.segments = []; | ||
data[key].forEach(function (range) { | ||
var segment = { start: context._dateParserData(range[0]), end: context._dateParserData(range[1]) }; | ||
obj.segments.push(segment); | ||
}); | ||
this_1._chart.dataProvider.push(obj); | ||
}; | ||
var this_1 = this; | ||
for (var key in data) { | ||
_loop_1(key); | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/gantt", "d3-time-format"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/gantt"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var AmCharts = window.AmCharts; | ||
var Gantt = (function (_super) { | ||
tslib_1.__extends(Gantt, _super); | ||
function Gantt() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
_this._dateParserData = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevTimePattern = this.timePattern(); | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context._chart.dataProvider[i].color = context._palette(i); | ||
}); | ||
this._chart.columnWidth = this.columnWidth(); | ||
this._chart.colorField = "color"; | ||
this._chart.valueAxes[0].type = "date"; | ||
this._chart.valueAxes[0].minPeriod = this.minPeriod(); | ||
this._chart.brightnessStep = this.brightnessStep() || undefined; | ||
this._chart.categoryField = "category"; | ||
this._chart.segmentsField = "segments"; | ||
this._chart.startDateField = "start"; | ||
this._chart.endDateField = "end"; | ||
this._chart.guides = this.guides(); | ||
}; | ||
Gantt.prototype.amFormattedData = function () { | ||
var obj = {}; | ||
this.data().forEach(function (row) { | ||
if (!obj[row[0]]) { | ||
obj[row[0]] = []; | ||
Gantt.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.depth3D = this.depth3D(); | ||
this._chart.angle = this.angle3D(); | ||
if (this._dataUpdated > this._prevDataUpdated || this._prevTimePattern !== this.timePattern()) { | ||
this._chart.dataProvider = []; | ||
var data = this.amFormattedData(); | ||
var _loop_1 = function (key) { | ||
var obj = {}; | ||
obj.category = key; | ||
obj.segments = []; | ||
data[key].forEach(function (range) { | ||
var segment = { start: context._dateParserData(range[0]), end: context._dateParserData(range[1]) }; | ||
obj.segments.push(segment); | ||
}); | ||
this_1._chart.dataProvider.push(obj); | ||
}; | ||
var this_1 = this; | ||
for (var key in data) { | ||
_loop_1(key); | ||
} | ||
} | ||
row.forEach(function (data, idx) { | ||
if (idx === 0) { | ||
return; | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevTimePattern = this.timePattern(); | ||
this._chart.dataProvider.forEach(function (dataPoint, i) { | ||
context._chart.dataProvider[i].color = context._palette(i); | ||
}); | ||
this._chart.columnWidth = this.columnWidth(); | ||
this._chart.colorField = "color"; | ||
this._chart.valueAxes[0].type = "date"; | ||
this._chart.valueAxes[0].minPeriod = this.minPeriod(); | ||
this._chart.brightnessStep = this.brightnessStep() || undefined; | ||
this._chart.categoryField = "category"; | ||
this._chart.segmentsField = "segments"; | ||
this._chart.startDateField = "start"; | ||
this._chart.endDateField = "end"; | ||
this._chart.guides = this.guides(); | ||
}; | ||
Gantt.prototype.amFormattedData = function () { | ||
var obj = {}; | ||
this.data().forEach(function (row) { | ||
if (!obj[row[0]]) { | ||
obj[row[0]] = []; | ||
} | ||
obj[row[0]].push(data); | ||
row.forEach(function (data, idx) { | ||
if (idx === 0) { | ||
return; | ||
} | ||
obj[row[0]].push(data); | ||
}); | ||
}); | ||
}); | ||
return obj; | ||
}; | ||
Gantt.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "gantt", | ||
theme: "none", | ||
autoMargins: true, | ||
valueAxis: {}, | ||
graph: { | ||
fillAlphas: 1, | ||
balloonText: "<b>[[category]]</b>: [[open]] - [[value]]" // TODO replace with balloon function | ||
}, | ||
rotate: true, | ||
dataProvider: [], | ||
chartScrollbar: {}, | ||
export: { | ||
enabled: true | ||
} | ||
return obj; | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var data = e.graph.segmentData; | ||
var field = "color"; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
Gantt.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "gantt", | ||
theme: "none", | ||
autoMargins: true, | ||
valueAxis: {}, | ||
graph: { | ||
fillAlphas: 1, | ||
balloonText: "<b>[[category]]</b>: [[open]] - [[value]]" // TODO replace with balloon function | ||
}, | ||
rotate: true, | ||
dataProvider: [], | ||
chartScrollbar: {}, | ||
export: { | ||
enabled: true | ||
} | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickGraphItem", function (e) { | ||
var data = e.graph.segmentData; | ||
var field = "color"; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
colIndex: e.target.columnIndex, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
colIndex: e.target.columnIndex, | ||
dIdx: e.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.columnIndex + 1], context._selected !== null); | ||
}); | ||
}; | ||
Gantt.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.index]), context.columns()[e.target.columnIndex + 1], context._selected !== null); | ||
}); | ||
}; | ||
Gantt.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Gantt.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
Gantt.prototype.data = function (_) { | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Gantt.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
Gantt.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
Gantt.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return Gantt; | ||
}(common_1.HTMLWidget)); | ||
exports.Gantt = Gantt; | ||
Gantt.prototype._class += " amchart_Gantt"; | ||
Gantt.prototype.implements(api_1.INDChart.prototype); // 2d? | ||
Gantt.prototype.publish("paletteID", "default", "set", "Palette ID", Gantt.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontFamily", "Verdana", "string", "Label Font Family", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontSize", 11, "number", "Label Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontColor", "#000000", "html-color", "Label Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
Gantt.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
Gantt.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time Series Pattern"); | ||
Gantt.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("brightnessStep", 0, "number", "Brightness step", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("columnWidth", 0.5, "number", "column width", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("minPeriod", "DD", "string", "Value axis minimum period", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("guides", [], "array", "Vertical lines", null, { tags: ["Intermediate"] }); | ||
var timePattern = Gantt.prototype.timePattern; | ||
Gantt.prototype.timePattern = function (_) { | ||
var retVal = timePattern.apply(this, arguments); | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
this._dateParserData = d3_time_format_1.timeParse(_); | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
return retVal; | ||
}; | ||
Gantt.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return Gantt; | ||
}(common_1.HTMLWidget)); | ||
exports.Gantt = Gantt; | ||
Gantt.prototype._class += " amchart_Gantt"; | ||
Gantt.prototype.implements(api_1.INDChart.prototype); // 2d? | ||
Gantt.prototype.publish("paletteID", "default", "set", "Palette ID", Gantt.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontFamily", "Verdana", "string", "Label Font Family", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontSize", 11, "number", "Label Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("fontColor", "#000000", "html-color", "Label Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Gantt.prototype.publish("depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
Gantt.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
Gantt.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time Series Pattern"); | ||
Gantt.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("brightnessStep", 0, "number", "Brightness step", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("columnWidth", 0.5, "number", "column width", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("minPeriod", "DD", "string", "Value axis minimum period", null, { tags: ["Basic"] }); | ||
Gantt.prototype.publish("guides", [], "array", "Vertical lines", null, { tags: ["Intermediate"] }); | ||
var timePattern = Gantt.prototype.timePattern; | ||
Gantt.prototype.timePattern = function (_) { | ||
var retVal = timePattern.apply(this, arguments); | ||
if (arguments.length) { | ||
this._dateParserData = d3_time_format_1.timeParse(_); | ||
} | ||
return retVal; | ||
}; | ||
}); | ||
//# sourceMappingURL=Gantt.js.map |
280
lib/Gauge.js
@@ -1,144 +0,154 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/gauge"); | ||
var d3_scale_1 = require("d3-scale"); | ||
var AmCharts = window.AmCharts; | ||
var Gauge = (function (_super) { | ||
tslib_1.__extends(Gauge, _super); | ||
function Gauge() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Gauge.prototype.updateChartOptions = function () { | ||
this._chart.type = "gauge"; | ||
this._chart.theme = "none"; | ||
this._chart.startDuration = this.animatationDuration(); | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.titles = []; | ||
this._chart.allLabels = []; | ||
if (this.marginLeft()) { | ||
this._chart.marginLeft = this.marginLeft(); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/gauge", "d3-scale"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/gauge"); | ||
var d3_scale_1 = require("d3-scale"); | ||
var AmCharts = window.AmCharts; | ||
var Gauge = (function (_super) { | ||
tslib_1.__extends(Gauge, _super); | ||
function Gauge() { | ||
var _this = _super.call(this) || this; | ||
_this._chart = {}; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
if (this.marginRight()) { | ||
this._chart.marginRight = this.marginRight(); | ||
} | ||
if (this.marginTop()) { | ||
this._chart.marginTop = this.marginTop(); | ||
} | ||
if (this.marginBottom()) { | ||
this._chart.marginBottom = this.marginBottom(); | ||
} | ||
this._chart.axes[0].axisThickness = this.axisLineWidth(); | ||
this._chart.axes[0].axisAlpha = this.axisAlpha(); | ||
this._chart.axes[0].tickAlpha = this.tickAlpha(); | ||
this._chart.axes[0].valueInterval = this.valueInterval(); | ||
this._chart.axes[0].bands = []; | ||
this._chart.axes[0].bottomText = this.bottomText(); | ||
this._chart.axes[0].bottomTextYOffset = this.bottomTextYOffset(); | ||
this._chart.axes[0].endValue = this.high(); | ||
this._chart.axes[0].startValue = this.low(); | ||
// 3 Color Methods | ||
var i; | ||
var l; | ||
if (this.colorType() === "a") { | ||
var scale = d3_scale_1.scaleLinear() | ||
.domain([0, 100]) | ||
.range([this.low(), this.high()]); | ||
for (i = 0, l = this.numBands(); i < l; i++) { | ||
var a_band = { | ||
color: this.bandsColor()[i], | ||
startValue: scale(this.bandsStartValue()[i]), | ||
endValue: scale(this.bandsEndValue()[i]), | ||
innerRadius: this.bandsInnerRadius()[i], | ||
}; | ||
this._chart.axes[0].bands.push(a_band); | ||
Gauge.prototype.updateChartOptions = function () { | ||
this._chart.type = "gauge"; | ||
this._chart.theme = "none"; | ||
this._chart.startDuration = this.animatationDuration(); | ||
this._chart.color = this.fontColor(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.titles = []; | ||
this._chart.allLabels = []; | ||
if (this.marginLeft()) { | ||
this._chart.marginLeft = this.marginLeft(); | ||
} | ||
} | ||
if (this.colorType() === "b") { | ||
for (i = 0, l = this.high(); i < l; i++) { | ||
var b_band = { | ||
color: this._palette(i, this.low(), this.high()), | ||
startValue: i, | ||
endValue: i + 1, | ||
// innerRadius: this._bandsInnerRadius[i] || "", // this has a cool effect might be useful? | ||
if (this.marginRight()) { | ||
this._chart.marginRight = this.marginRight(); | ||
} | ||
if (this.marginTop()) { | ||
this._chart.marginTop = this.marginTop(); | ||
} | ||
if (this.marginBottom()) { | ||
this._chart.marginBottom = this.marginBottom(); | ||
} | ||
this._chart.axes[0].axisThickness = this.axisLineWidth(); | ||
this._chart.axes[0].axisAlpha = this.axisAlpha(); | ||
this._chart.axes[0].tickAlpha = this.tickAlpha(); | ||
this._chart.axes[0].valueInterval = this.valueInterval(); | ||
this._chart.axes[0].bands = []; | ||
this._chart.axes[0].bottomText = this.bottomText(); | ||
this._chart.axes[0].bottomTextYOffset = this.bottomTextYOffset(); | ||
this._chart.axes[0].endValue = this.high(); | ||
this._chart.axes[0].startValue = this.low(); | ||
// 3 Color Methods | ||
var i; | ||
var l; | ||
if (this.colorType() === "a") { | ||
var scale = d3_scale_1.scaleLinear() | ||
.domain([0, 100]) | ||
.range([this.low(), this.high()]); | ||
for (i = 0, l = this.numBands(); i < l; i++) { | ||
var a_band = { | ||
color: this.bandsColor()[i], | ||
startValue: scale(this.bandsStartValue()[i]), | ||
endValue: scale(this.bandsEndValue()[i]), | ||
innerRadius: this.bandsInnerRadius()[i], | ||
}; | ||
this._chart.axes[0].bands.push(a_band); | ||
} | ||
} | ||
if (this.colorType() === "b") { | ||
for (i = 0, l = this.high(); i < l; i++) { | ||
var b_band = { | ||
color: this._palette(i, this.low(), this.high()), | ||
startValue: i, | ||
endValue: i + 1, | ||
// innerRadius: this._bandsInnerRadius[i] || "", // this has a cool effect might be useful? | ||
innerRadius: this.bandsInnerRadius()[0] | ||
}; | ||
this._chart.axes[0].bands.push(b_band); | ||
} | ||
} | ||
if (this.colorType() === "c") { | ||
var c_band = { | ||
color: this._palette(this.data(), this.low(), this.high()), | ||
startValue: this.low(), | ||
endValue: this.high(), | ||
innerRadius: this.bandsInnerRadius()[0] | ||
}; | ||
this._chart.axes[0].bands.push(b_band); | ||
this._chart.axes[0].bands.push(c_band); | ||
} | ||
} | ||
if (this.colorType() === "c") { | ||
var c_band = { | ||
color: this._palette(this.data(), this.low(), this.high()), | ||
startValue: this.low(), | ||
endValue: this.high(), | ||
innerRadius: this.bandsInnerRadius()[0] | ||
this._chart.axes[0].bottomText = this.bottomText().replace("[[data]]", this.data()); | ||
return this._chart; | ||
}; | ||
Gauge.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.arrows[0].setValue(this.data()); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Gauge.prototype.enter = function (domNode, element) { | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
var initObj = { | ||
type: "gauge", | ||
addClassNames: true, | ||
axes: [{}], | ||
arrows: [{}], | ||
}; | ||
this._chart.axes[0].bands.push(c_band); | ||
} | ||
this._chart.axes[0].bottomText = this.bottomText().replace("[[data]]", this.data()); | ||
return this._chart; | ||
}; | ||
Gauge.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.arrows[0].setValue(this.data()); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Gauge.prototype.enter = function (domNode, element) { | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
var initObj = { | ||
type: "gauge", | ||
addClassNames: true, | ||
axes: [{}], | ||
arrows: [{}], | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
}; | ||
return Gauge; | ||
}(common_1.HTMLWidget)); | ||
exports.Gauge = Gauge; | ||
Gauge.prototype._class += " amchart_Gauge"; | ||
Gauge.prototype.implements(api_1.I1DChart.prototype); | ||
Gauge.prototype.publish("paletteID", "default", "set", "Palette ID", Gauge.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("low", 0, "number", "Gauge lower bound", null, { tags: ["Intermediate", "Shared"] }); | ||
Gauge.prototype.publish("high", 100, "number", "Gauge higher bound", null, { tags: ["Intermediate", "Shared"] }); | ||
Gauge.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
Gauge.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("colorType", "a", "set", "", ["a", "b", "c"], { tags: ["Basic"] }); | ||
Gauge.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("numBands", null, "number", "", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("bandsColor", [], "array", "Bands Color", null, { tags: ["Basic"] }); | ||
Gauge.prototype.publish("bandsStartValue", [], "array", "Bands Start Value %", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("bandsEndValue", [], "array", "Bands End Value %", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("bandsInnerRadius", [], "array", "Bands Inner Radius", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("axisAlpha", 0.2, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("tickAlpha", 0.2, "number", "Tick Alpha", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("valueInterval", null, "number", "Value Interval", null, { tags: ["Advanced"], optional: true }); | ||
Gauge.prototype.publish("bottomText", "", "string", "Text Along Bottom", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("bottomTextYOffset", -20, "number", "Bottom Text Vertical Offset", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("animatationDuration", 2, "number", "Animation Duration (sec)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
return Gauge; | ||
}(common_1.HTMLWidget)); | ||
exports.Gauge = Gauge; | ||
Gauge.prototype._class += " amchart_Gauge"; | ||
Gauge.prototype.implements(api_1.I1DChart.prototype); | ||
Gauge.prototype.publish("paletteID", "default", "set", "Palette ID", Gauge.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("low", 0, "number", "Gauge lower bound", null, { tags: ["Intermediate", "Shared"] }); | ||
Gauge.prototype.publish("high", 100, "number", "Gauge higher bound", null, { tags: ["Intermediate", "Shared"] }); | ||
Gauge.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
Gauge.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Gauge.prototype.publish("axisLineWidth", 1, "number", "Thickness of axis", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("colorType", "a", "set", "", ["a", "b", "c"], { tags: ["Basic"] }); | ||
Gauge.prototype.publish("marginLeft", null, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginRight", null, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginTop", null, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("marginBottom", null, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("numBands", null, "number", "", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("bandsColor", [], "array", "Bands Color", null, { tags: ["Basic"] }); | ||
Gauge.prototype.publish("bandsStartValue", [], "array", "Bands Start Value %", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("bandsEndValue", [], "array", "Bands End Value %", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("bandsInnerRadius", [], "array", "Bands Inner Radius", null, { tags: ["Advanced"] }); | ||
Gauge.prototype.publish("axisAlpha", 0.2, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("tickAlpha", 0.2, "number", "Tick Alpha", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("valueInterval", null, "number", "Value Interval", null, { tags: ["Advanced"], optional: true }); | ||
Gauge.prototype.publish("bottomText", "", "string", "Text Along Bottom", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("bottomTextYOffset", -20, "number", "Bottom Text Vertical Offset", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("animatationDuration", 2, "number", "Animation Duration (sec)", null, { tags: ["Intermediate"] }); | ||
Gauge.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
}); | ||
//# sourceMappingURL=Gauge.js.map |
@@ -1,26 +0,36 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("amcharts3/amcharts/amcharts"); | ||
__export(require("./Area")); | ||
__export(require("./Axis")); | ||
__export(require("./Bar")); | ||
__export(require("./Column")); | ||
__export(require("./Combo")); | ||
__export(require("./CommonFunnel")); | ||
__export(require("./CommonRadar")); | ||
__export(require("./CommonSerial")); | ||
__export(require("./CommonXY")); | ||
__export(require("./Funnel")); | ||
__export(require("./Gantt")); | ||
__export(require("./Gauge")); | ||
__export(require("./Line")); | ||
__export(require("./Pie")); | ||
__export(require("./Polar")); | ||
__export(require("./Pyramid")); | ||
__export(require("./Scatter")); | ||
__export(require("./SerialAxis")); | ||
__export(require("./XYAxis")); | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "amcharts3/amcharts/amcharts", "./Area", "./Axis", "./Bar", "./Column", "./Combo", "./CommonFunnel", "./CommonRadar", "./CommonSerial", "./CommonXY", "./Funnel", "./Gantt", "./Gauge", "./Line", "./Pie", "./Polar", "./Pyramid", "./Scatter", "./SerialAxis", "./XYAxis"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("amcharts3/amcharts/amcharts"); | ||
__export(require("./Area")); | ||
__export(require("./Axis")); | ||
__export(require("./Bar")); | ||
__export(require("./Column")); | ||
__export(require("./Combo")); | ||
__export(require("./CommonFunnel")); | ||
__export(require("./CommonRadar")); | ||
__export(require("./CommonSerial")); | ||
__export(require("./CommonXY")); | ||
__export(require("./Funnel")); | ||
__export(require("./Gantt")); | ||
__export(require("./Gauge")); | ||
__export(require("./Line")); | ||
__export(require("./Pie")); | ||
__export(require("./Polar")); | ||
__export(require("./Pyramid")); | ||
__export(require("./Scatter")); | ||
__export(require("./SerialAxis")); | ||
__export(require("./XYAxis")); | ||
}); | ||
//# sourceMappingURL=index.js.map |
120
lib/Line.js
@@ -1,60 +0,70 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
var Line = (function (_super) { | ||
tslib_1.__extends(Line, _super); | ||
function Line() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "line"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Line.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Line.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Line.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "./CommonSerial"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonSerial_1 = require("./CommonSerial"); | ||
var Line = (function (_super) { | ||
tslib_1.__extends(Line, _super); | ||
function Line() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "line"; | ||
return _this; | ||
} | ||
function buildGraphObj(gObj, i) { | ||
if (this.stepLines()) { | ||
gObj.type = "step"; | ||
Line.prototype.enter = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.enter.apply(this, arguments); | ||
}; | ||
Line.prototype.updateChartOptions = function () { | ||
CommonSerial_1.CommonSerial.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Line.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonSerial_1.CommonSerial.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
else if (this.smoothLines()) { | ||
gObj.type = "smoothedLine"; | ||
function buildGraphObj(gObj, i) { | ||
if (this.stepLines()) { | ||
gObj.type = "step"; | ||
} | ||
else if (this.smoothLines()) { | ||
gObj.type = "smoothedLine"; | ||
} | ||
else { | ||
gObj.type = "line"; | ||
} | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
return gObj; | ||
} | ||
else { | ||
gObj.type = "line"; | ||
} | ||
gObj.bullet = this.bulletType(); | ||
gObj.bulletSize = this.bulletSize(); | ||
return gObj; | ||
} | ||
}; | ||
Line.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Line; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Line = Line; | ||
Line.prototype._class += " amchart_Line"; | ||
Line.prototype.implements(api_1.INDChart.prototype); | ||
Line.prototype.publish("paletteID", "default", "set", "Palette ID", Line.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Line.prototype.publish("smoothLines", false, "boolean", "Causes chart data lines to draw smoothly", null, { tags: ["Basic", "Shared"] }); | ||
Line.prototype.publish("stepLines", false, "boolean", "Causes chart data lines to draw smoothly", null, { tags: ["Basic"] }); | ||
Line.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Line.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
}; | ||
Line.prototype.update = function (domNode, element) { | ||
CommonSerial_1.CommonSerial.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Line; | ||
}(CommonSerial_1.CommonSerial)); | ||
exports.Line = Line; | ||
Line.prototype._class += " amchart_Line"; | ||
Line.prototype.implements(api_1.INDChart.prototype); | ||
Line.prototype.publish("paletteID", "default", "set", "Palette ID", Line.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Line.prototype.publish("smoothLines", false, "boolean", "Causes chart data lines to draw smoothly", null, { tags: ["Basic", "Shared"] }); | ||
Line.prototype.publish("stepLines", false, "boolean", "Causes chart data lines to draw smoothly", null, { tags: ["Basic"] }); | ||
Line.prototype.publish("bulletSize", 6, "number", "Bullet Size", null, { tags: ["Intermediate"] }); | ||
Line.prototype.publish("bulletType", "round", "set", "Bullet Type", ["none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "bubble", "diamond"], { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=Line.js.map |
464
lib/Pie.js
@@ -1,245 +0,255 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var api_2 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/pie"); | ||
var d3_array_1 = require("d3-array"); | ||
var d3_format_1 = require("d3-format"); | ||
var d3_selection_1 = require("d3-selection"); | ||
var AmCharts = window.AmCharts; | ||
var Pie = (function (_super) { | ||
tslib_1.__extends(Pie, _super); | ||
function Pie() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Pie.prototype.calcRadius = function () { | ||
return Math.min(this._size.width, this._size.height) / 2 - 2; | ||
}; | ||
Pie.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.type = "pie"; | ||
this._chart.labelsEnabled = true; | ||
if (this.labelPosition() === "inside") { | ||
this._chart.radius = "50%"; | ||
this._chart.labelRadius = -40; | ||
this._chart.pullOutRadius = "20%"; | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "@hpcc-js/api", "@hpcc-js/common", "amcharts3/amcharts/amcharts", "amcharts3/amcharts/pie", "d3-array", "d3-format", "d3-selection"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var api_2 = require("@hpcc-js/api"); | ||
var common_1 = require("@hpcc-js/common"); | ||
require("amcharts3/amcharts/amcharts"); | ||
require("amcharts3/amcharts/pie"); | ||
var d3_array_1 = require("d3-array"); | ||
var d3_format_1 = require("d3-format"); | ||
var d3_selection_1 = require("d3-selection"); | ||
var AmCharts = window.AmCharts; | ||
var Pie = (function (_super) { | ||
tslib_1.__extends(Pie, _super); | ||
function Pie() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._chart = {}; | ||
_this._selected = null; | ||
_this._selections = []; | ||
_this._dataUpdated = 0; | ||
_this._prevDataUpdated = -1; | ||
_this._columnsUpdated = 0; | ||
_this._prevColumnsUpdated = -1; | ||
return _this; | ||
} | ||
else { | ||
this._chart.radius = this.calcRadius(); | ||
this._chart.labelRadius = 20; | ||
this._chart.pullOutRadius = "20%"; | ||
} | ||
this._chart.labelFunction = function (d) { | ||
return d.title; | ||
Pie.prototype.calcRadius = function () { | ||
return Math.min(this._size.width, this._size.height) / 2 - 2; | ||
}; | ||
this._chart.marginRight = this.marginRight(); | ||
this._chart.marginLeft = this.marginLeft(); | ||
this._chart.marginTop = this.marginTop(); | ||
this._chart.marginBottom = this.marginBottom(); | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
this._chart.innerRadius = this.holePercent() + "%"; | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.color = this.fontColor(); | ||
this._chart.titleField = this.columns()[0]; | ||
this._chart.valueField = this.columns()[1]; | ||
var sortingMethod; | ||
if (this.reverseDataSorting()) { | ||
sortingMethod = function (a, b) { return a[1] < b[1] ? 1 : -1; }; | ||
} | ||
else { | ||
sortingMethod = function (a, b) { return a[1] > b[1] ? 1 : -1; }; | ||
} | ||
this.data().sort(sortingMethod); | ||
this._chart.colorField = "sliceColor"; | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._chart.colors = this.data().map(function (row) { | ||
return this._palette(row[0]); | ||
}, this); | ||
this._chart.pullOutOnlyOne = this.selectionMode() === "simple"; | ||
this.pieAlpha().forEach(function (d, i) { | ||
if (typeof (this._chart.chartData[i]) === "undefined") { | ||
this._chart.chartData[i] = {}; | ||
Pie.prototype.updateChartOptions = function () { | ||
var context = this; | ||
this._chart.type = "pie"; | ||
this._chart.labelsEnabled = true; | ||
if (this.labelPosition() === "inside") { | ||
this._chart.radius = "50%"; | ||
this._chart.labelRadius = -40; | ||
this._chart.pullOutRadius = "20%"; | ||
} | ||
this._chart.chartData[i].alpha = d; | ||
}, this); | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ": " + d3_format_1.format(",.2%")(d.percents / 100) + " " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
else { | ||
this._chart.radius = this.calcRadius(); | ||
this._chart.labelRadius = 20; | ||
this._chart.pullOutRadius = "20%"; | ||
} | ||
this._chart.labelFunction = function (d) { | ||
return d.title; | ||
}; | ||
this._chart.marginRight = this.marginRight(); | ||
this._chart.marginLeft = this.marginLeft(); | ||
this._chart.marginTop = this.marginTop(); | ||
this._chart.marginBottom = this.marginBottom(); | ||
this._chart.depth3D = this.Depth3D(); | ||
this._chart.angle = this.Angle3D(); | ||
this._chart.innerRadius = this.holePercent() + "%"; | ||
this._chart.fontFamily = this.fontFamily(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.fontSize = this.fontSize(); | ||
this._chart.color = this.fontColor(); | ||
this._chart.titleField = this.columns()[0]; | ||
this._chart.valueField = this.columns()[1]; | ||
var sortingMethod; | ||
if (this.reverseDataSorting()) { | ||
sortingMethod = function (a, b) { return a[1] < b[1] ? 1 : -1; }; | ||
} | ||
else { | ||
sortingMethod = function (a, b) { return a[1] > b[1] ? 1 : -1; }; | ||
} | ||
this.data().sort(sortingMethod); | ||
this._chart.colorField = "sliceColor"; | ||
if (this._dataUpdated > this._prevDataUpdated || this._columnsUpdated > this._prevColumnsUpdated) { | ||
this._chart.dataProvider = this.formatData(this.data()); | ||
} | ||
this._prevDataUpdated = this._dataUpdated; | ||
this._prevColumnsUpdated = this._columnsUpdated; | ||
this._chart.colors = this.data().map(function (row) { | ||
return this._palette(row[0]); | ||
}, this); | ||
this._chart.pullOutOnlyOne = this.selectionMode() === "simple"; | ||
this.pieAlpha().forEach(function (d, i) { | ||
if (typeof (this._chart.chartData[i]) === "undefined") { | ||
this._chart.chartData[i] = {}; | ||
} | ||
this._chart.chartData[i].alpha = d; | ||
}, this); | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ": " + d3_format_1.format(",.2%")(d.percents / 100) + " " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
} | ||
}; | ||
return this._chart; | ||
}; | ||
return this._chart; | ||
}; | ||
Pie.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
Pie.prototype.formatData = function (dataArr) { | ||
var dataObjArr = []; | ||
var context = this; | ||
dataArr.forEach(function (dataRow) { | ||
var dataObj = {}; | ||
context.columns().forEach(function (colName, cIdx) { | ||
dataObj[colName] = dataRow[cIdx]; | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
dataObjArr.push(dataObj); | ||
}); | ||
return dataObjArr; | ||
}; | ||
Pie.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "pie", | ||
addClassNames: true, | ||
theme: "none" | ||
return dataObjArr; | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickSlice", function (e) { | ||
var field = e.chart.colorField; | ||
var data = e.dataItem.dataContext; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
Pie.prototype.enter = function (domNode, element) { | ||
common_1.HTMLWidget.prototype.enter.apply(this, arguments); | ||
var context = this; | ||
var initObj = { | ||
type: "pie", | ||
addClassNames: true, | ||
theme: "none" | ||
}; | ||
if (typeof window.define === "function" && window.define.amd) { | ||
initObj.pathToImages = window.require.toUrl("amchartsImg"); | ||
} | ||
this._chart = AmCharts.makeChart(domNode, initObj); | ||
this._chart.addListener("clickSlice", function (e) { | ||
var field = e.chart.colorField; | ||
var data = e.dataItem.dataContext; | ||
if (data[field] !== null && data[field] !== undefined) { | ||
delete data[field]; | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = null; | ||
} | ||
context._selected = null; | ||
} | ||
} | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
else { | ||
data[field] = context.selectionColor(); | ||
if (context.selectionMode() === "simple") { | ||
if (context._selected !== null) { | ||
delete context._selected.data[context._selected.field]; | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: 1, | ||
dIdx: e.dataItem.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
context._selected = { | ||
field: field, | ||
data: data, | ||
cIdx: 1, | ||
dIdx: e.dataItem.index | ||
}; | ||
context._selections.push(context._selected); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.dataItem.index]), context.columns()[1], context._selected !== null); | ||
}); | ||
}; | ||
Pie.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
e.chart.validateData(); | ||
context.click(context.rowToObj(context.data()[e.dataItem.index]), context.columns()[1], context._selected !== null); | ||
}); | ||
}; | ||
Pie.prototype.update = function (domNode, element) { | ||
this._palette = this._palette.switch(this.paletteID()); | ||
if (this.useClonedPalette()) { | ||
this._palette = this._palette.cloneNotExists(this.paletteID() + "_" + this.id()); | ||
} | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Pie.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
Pie.prototype.postUpdate = function (domNode, element) { | ||
var context = this; | ||
var containerBoundingClientRect = context._element.select("svg").node().getBoundingClientRect(); // might need to change this selection (could get a bit more accurate results?) | ||
this.d3LabelSelection = element.selectAll(".amcharts-pie-label"); | ||
var left = []; | ||
var right = []; | ||
var top = []; | ||
var bottom = []; | ||
this.d3LabelSelection.each(function (d, i) { | ||
var boundingRect = d3_selection_1.select(this).node().getBoundingClientRect(); | ||
var labelTopPos = boundingRect.top; | ||
if (labelTopPos < containerBoundingClientRect.top) { | ||
top.push(labelTopPos - containerBoundingClientRect.top); | ||
domNode.style.width = this.size().width + "px"; | ||
domNode.style.height = this.size().height + "px"; | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
Pie.prototype.render = function (callback) { | ||
return common_1.HTMLWidget.prototype.render.apply(this, arguments); | ||
}; | ||
Pie.prototype.postUpdate = function (domNode, element) { | ||
var context = this; | ||
var containerBoundingClientRect = context._element.select("svg").node().getBoundingClientRect(); // might need to change this selection (could get a bit more accurate results?) | ||
this.d3LabelSelection = element.selectAll(".amcharts-pie-label"); | ||
var left = []; | ||
var right = []; | ||
var top = []; | ||
var bottom = []; | ||
this.d3LabelSelection.each(function (d, i) { | ||
var boundingRect = d3_selection_1.select(this).node().getBoundingClientRect(); | ||
var labelTopPos = boundingRect.top; | ||
if (labelTopPos < containerBoundingClientRect.top) { | ||
top.push(labelTopPos - containerBoundingClientRect.top); | ||
} | ||
var labelBottomPos = boundingRect.bottom; | ||
if (labelBottomPos > containerBoundingClientRect.bottom) { | ||
bottom.push(containerBoundingClientRect.bottom - labelTopPos); | ||
} | ||
var labelRightPos = boundingRect.right; | ||
if (labelRightPos > containerBoundingClientRect.right) { | ||
right.push(containerBoundingClientRect.right - labelRightPos); | ||
} | ||
var labelLeftPos = boundingRect.left; | ||
if (labelLeftPos < containerBoundingClientRect.left) { | ||
left.push(labelLeftPos - containerBoundingClientRect.left); | ||
} | ||
}); | ||
var topOffset = top.length ? d3_array_1.min(top) : 0; | ||
var bottomOffset = bottom.length ? d3_array_1.min(bottom) : 0; | ||
var rightOffset = right.length ? d3_array_1.min(right) : 0; | ||
var leftOffset = left.length ? d3_array_1.min(left) : 0; | ||
var smallerOffset = 0; | ||
if (topOffset < 0) { | ||
smallerOffset += topOffset; | ||
} | ||
var labelBottomPos = boundingRect.bottom; | ||
if (labelBottomPos > containerBoundingClientRect.bottom) { | ||
bottom.push(containerBoundingClientRect.bottom - labelTopPos); | ||
if (bottomOffset < 0) { | ||
smallerOffset += bottomOffset; | ||
} | ||
var labelRightPos = boundingRect.right; | ||
if (labelRightPos > containerBoundingClientRect.right) { | ||
right.push(containerBoundingClientRect.right - labelRightPos); | ||
if (rightOffset < 0) { | ||
smallerOffset += rightOffset; | ||
} | ||
var labelLeftPos = boundingRect.left; | ||
if (labelLeftPos < containerBoundingClientRect.left) { | ||
left.push(labelLeftPos - containerBoundingClientRect.left); | ||
if (leftOffset < 0) { | ||
smallerOffset += leftOffset; | ||
} | ||
}); | ||
var topOffset = top.length ? d3_array_1.min(top) : 0; | ||
var bottomOffset = bottom.length ? d3_array_1.min(bottom) : 0; | ||
var rightOffset = right.length ? d3_array_1.min(right) : 0; | ||
var leftOffset = left.length ? d3_array_1.min(left) : 0; | ||
var smallerOffset = 0; | ||
if (topOffset < 0) { | ||
smallerOffset += topOffset; | ||
} | ||
if (bottomOffset < 0) { | ||
smallerOffset += bottomOffset; | ||
} | ||
if (rightOffset < 0) { | ||
smallerOffset += rightOffset; | ||
} | ||
if (leftOffset < 0) { | ||
smallerOffset += leftOffset; | ||
} | ||
if (this.calcRadius() + smallerOffset - 20 < this.calcRadius()) { | ||
this._chart.radius = this.calcRadius() + smallerOffset - 20; // 20 for the label line lengths | ||
this._chart.validateNow(); | ||
} | ||
}; | ||
Pie.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
Pie.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return Pie; | ||
}(common_1.HTMLWidget)); | ||
exports.Pie = Pie; | ||
Pie.prototype._class += " amchart_Pie"; | ||
Pie.prototype.implements(api_2.I2DChart.prototype); | ||
Pie.prototype.implements(api_1.ITooltip.prototype); | ||
Pie.prototype.publish("paletteID", "default", "set", "Palette ID", Pie.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
Pie.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
Pie.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("marginLeft", 0, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginRight", 0, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginTop", 0, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginBottom", 0, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("reverseDataSorting", false, "boolean", "Reverse Data Sorting", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("holePercent", 0, "number", "Hole Size (Percent)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("radius", null, "number", "Radius", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("pieAlpha", [], "array", "Individual Alpha per Slice", null, { tags: ["Private"] }); | ||
Pie.prototype.publish("labelPosition", "outside", "set", "Label Position", ["inside", "outside"], { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
if (this.calcRadius() + smallerOffset - 20 < this.calcRadius()) { | ||
this._chart.radius = this.calcRadius() + smallerOffset - 20; // 20 for the label line lengths | ||
this._chart.validateNow(); | ||
} | ||
}; | ||
Pie.prototype.data = function (_) { | ||
if (arguments.length) { | ||
this._dataUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.data.apply(this, arguments); | ||
}; | ||
Pie.prototype.columns = function (_) { | ||
if (arguments.length) { | ||
this._columnsUpdated++; | ||
} | ||
return common_1.HTMLWidget.prototype.columns.apply(this, arguments); | ||
}; | ||
return Pie; | ||
}(common_1.HTMLWidget)); | ||
exports.Pie = Pie; | ||
Pie.prototype._class += " amchart_Pie"; | ||
Pie.prototype.implements(api_2.I2DChart.prototype); | ||
Pie.prototype.implements(api_1.ITooltip.prototype); | ||
Pie.prototype.publish("paletteID", "default", "set", "Palette ID", Pie.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette", null, { tags: ["Intermediate", "Shared"] }); | ||
Pie.prototype.publish("fontSize", 11, "number", "Font Size", null, { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("fontFamily", "Verdana", "string", "Font Name", null, { tags: ["Basic", "Shared", "Shared"] }); | ||
Pie.prototype.publish("fontColor", "#000000", "html-color", "Font Color", null, { tags: ["Basic", "Shared"] }); | ||
Pie.prototype.publish("Depth3D", 0, "number", "3D Depth (px)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("marginLeft", 0, "number", "Margin (Left)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginRight", 0, "number", "Margin (Right)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginTop", 0, "number", "Margin (Top)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("marginBottom", 0, "number", "Margin (Bottom)", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("reverseDataSorting", false, "boolean", "Reverse Data Sorting", null, { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("holePercent", 0, "number", "Hole Size (Percent)", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("radius", null, "number", "Radius", null, { tags: ["Basic"] }); | ||
Pie.prototype.publish("pieAlpha", [], "array", "Individual Alpha per Slice", null, { tags: ["Private"] }); | ||
Pie.prototype.publish("labelPosition", "outside", "set", "Label Position", ["inside", "outside"], { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("selectionMode", "simple", "set", "Selection Mode", ["simple", "multi"], { tags: ["Intermediate"] }); | ||
Pie.prototype.publish("selectionColor", "#f00", "html-color", "Font Color", null, { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=Pie.js.map |
100
lib/Polar.js
@@ -1,48 +0,58 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
require("amcharts3/amcharts/radar"); | ||
var CommonRadar_1 = require("./CommonRadar"); | ||
require("../src/Area.css"); | ||
var Polar = (function (_super) { | ||
tslib_1.__extends(Polar, _super); | ||
function Polar() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Polar.prototype.enter = function (domNode, element) { | ||
CommonRadar_1.CommonRadar.prototype.enter.apply(this, arguments); | ||
}; | ||
Polar.prototype.updateChartOptions = function () { | ||
CommonRadar_1.CommonRadar.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Polar.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonRadar_1.CommonRadar.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, this._valueField[i], i); | ||
this._chart.addGraph(gObj); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "amcharts3/amcharts/radar", "./CommonRadar", "../src/Area.css"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
require("amcharts3/amcharts/radar"); | ||
var CommonRadar_1 = require("./CommonRadar"); | ||
require("../src/Area.css"); | ||
var Polar = (function (_super) { | ||
tslib_1.__extends(Polar, _super); | ||
function Polar() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
_this._gType = "column"; | ||
return _this; | ||
} | ||
function buildGraphObj(gObj, valueField) { | ||
gObj.valueField = valueField; | ||
return gObj; | ||
} | ||
}; | ||
Polar.prototype.update = function (domNode, element) { | ||
CommonRadar_1.CommonRadar.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Polar; | ||
}(CommonRadar_1.CommonRadar)); | ||
exports.Polar = Polar; | ||
Polar.prototype._class += " amchart_Polar"; | ||
Polar.prototype.implements(api_1.INDChart.prototype); | ||
Polar.prototype.publish("paletteID", "default", "set", "Palette ID", Polar.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Polar.prototype.enter = function (domNode, element) { | ||
CommonRadar_1.CommonRadar.prototype.enter.apply(this, arguments); | ||
}; | ||
Polar.prototype.updateChartOptions = function () { | ||
CommonRadar_1.CommonRadar.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Polar.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length - 1; i++) { | ||
var gRetVal = CommonRadar_1.CommonRadar.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, this._valueField[i], i); | ||
this._chart.addGraph(gObj); | ||
} | ||
function buildGraphObj(gObj, valueField) { | ||
gObj.valueField = valueField; | ||
return gObj; | ||
} | ||
}; | ||
Polar.prototype.update = function (domNode, element) { | ||
CommonRadar_1.CommonRadar.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Polar; | ||
}(CommonRadar_1.CommonRadar)); | ||
exports.Polar = Polar; | ||
Polar.prototype._class += " amchart_Polar"; | ||
Polar.prototype.implements(api_1.INDChart.prototype); | ||
Polar.prototype.publish("paletteID", "default", "set", "Palette ID", Polar.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
}); | ||
//# sourceMappingURL=Polar.js.map |
@@ -1,35 +0,45 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var d3_format_1 = require("d3-format"); | ||
var CommonFunnel_1 = require("./CommonFunnel"); | ||
var Pyramid = (function (_super) { | ||
tslib_1.__extends(Pyramid, _super); | ||
function Pyramid() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Pyramid.prototype.enter = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.enter.apply(this, arguments); | ||
}; | ||
Pyramid.prototype.updateChartOptions = function () { | ||
CommonFunnel_1.CommonFunnel.prototype.updateChartOptions.apply(this, arguments); | ||
var context = this; | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ": " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
} | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "d3-format", "./CommonFunnel"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var d3_format_1 = require("d3-format"); | ||
var CommonFunnel_1 = require("./CommonFunnel"); | ||
var Pyramid = (function (_super) { | ||
tslib_1.__extends(Pyramid, _super); | ||
function Pyramid() { | ||
var _this = _super.call(this) || this; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
Pyramid.prototype.enter = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.enter.apply(this, arguments); | ||
}; | ||
}; | ||
Pyramid.prototype.update = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.update.apply(this, arguments); | ||
}; | ||
return Pyramid; | ||
}(CommonFunnel_1.CommonFunnel)); | ||
exports.Pyramid = Pyramid; | ||
Pyramid.prototype._class += " amchart_Pyramid"; | ||
Pyramid.prototype.implements(api_1.I2DChart.prototype); | ||
Pyramid.prototype.publish("paletteID", "default", "set", "Palette ID", Pyramid.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Pyramid.prototype.updateChartOptions = function () { | ||
CommonFunnel_1.CommonFunnel.prototype.updateChartOptions.apply(this, arguments); | ||
var context = this; | ||
this._chart.balloonFunction = function (d) { | ||
if (context && context.tooltipValueFormat) { | ||
return d.title + ": " + d3_format_1.format(context.tooltipValueFormat())(d.value); | ||
} | ||
}; | ||
}; | ||
Pyramid.prototype.update = function (domNode, element) { | ||
CommonFunnel_1.CommonFunnel.prototype.update.apply(this, arguments); | ||
}; | ||
return Pyramid; | ||
}(CommonFunnel_1.CommonFunnel)); | ||
exports.Pyramid = Pyramid; | ||
Pyramid.prototype._class += " amchart_Pyramid"; | ||
Pyramid.prototype.implements(api_1.I2DChart.prototype); | ||
Pyramid.prototype.publish("paletteID", "default", "set", "Palette ID", Pyramid.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
}); | ||
//# sourceMappingURL=Pyramid.js.map |
@@ -1,53 +0,63 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonXY_1 = require("./CommonXY"); | ||
var Scatter = (function (_super) { | ||
tslib_1.__extends(Scatter, _super); | ||
function Scatter() { | ||
var _this = _super.call(this) || this; | ||
_this._type = "Scatter"; | ||
_this._gType = "column"; | ||
_this._tag = "div"; | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
Scatter.prototype.enter = function (domNode, element) { | ||
CommonXY_1.CommonXY.prototype.enter.apply(this, arguments); | ||
}; | ||
Scatter.prototype.updateChartOptions = function () { | ||
CommonXY_1.CommonXY.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Scatter.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length; i++) { | ||
var gRetVal = CommonXY_1.CommonXY.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "@hpcc-js/api", "./CommonXY"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var api_1 = require("@hpcc-js/api"); | ||
var CommonXY_1 = require("./CommonXY"); | ||
var Scatter = (function (_super) { | ||
tslib_1.__extends(Scatter, _super); | ||
function Scatter() { | ||
var _this = _super.call(this) || this; | ||
_this._type = "Scatter"; | ||
_this._gType = "column"; | ||
_this._tag = "div"; | ||
return _this; | ||
} | ||
function buildGraphObj(gObj) { | ||
if (this.scatterType() === "bubble") { | ||
gObj["valueField"] = this.columns()[2]; | ||
Scatter.prototype.enter = function (domNode, element) { | ||
CommonXY_1.CommonXY.prototype.enter.apply(this, arguments); | ||
}; | ||
Scatter.prototype.updateChartOptions = function () { | ||
CommonXY_1.CommonXY.prototype.updateChartOptions.apply(this, arguments); | ||
this.buildGraphs(this._gType); | ||
return this._chart; | ||
}; | ||
Scatter.prototype.buildGraphs = function (gType) { | ||
this._chart.graphs = []; | ||
for (var i = 0; i < this.columns().length; i++) { | ||
var gRetVal = CommonXY_1.CommonXY.prototype.buildGraphObj.call(this, gType, i); | ||
var gObj = buildGraphObj.call(this, gRetVal, i); | ||
this._chart.addGraph(gObj); | ||
} | ||
else { | ||
delete gObj["valueField"]; | ||
function buildGraphObj(gObj) { | ||
if (this.scatterType() === "bubble") { | ||
gObj["valueField"] = this.columns()[2]; | ||
} | ||
else { | ||
delete gObj["valueField"]; | ||
} | ||
return gObj; | ||
} | ||
return gObj; | ||
} | ||
}; | ||
Scatter.prototype.update = function (domNode, element) { | ||
CommonXY_1.CommonXY.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Scatter; | ||
}(CommonXY_1.CommonXY)); | ||
exports.Scatter = Scatter; | ||
Scatter.prototype._class += " amchart_Scatter"; | ||
Scatter.prototype.implements(api_1.INDChart.prototype); | ||
Scatter.prototype.publish("paletteID", "default", "set", "Palette ID", Scatter.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Scatter.prototype.publish("scatterType", "scatter", "set", "Bullet Type", ["scatter", "bubble"], { tags: ["Basic"] }); | ||
}; | ||
Scatter.prototype.update = function (domNode, element) { | ||
CommonXY_1.CommonXY.prototype.update.apply(this, arguments); | ||
this.updateChartOptions(); | ||
this._chart.validateNow(); | ||
this._chart.validateData(); | ||
}; | ||
return Scatter; | ||
}(CommonXY_1.CommonXY)); | ||
exports.Scatter = Scatter; | ||
Scatter.prototype._class += " amchart_Scatter"; | ||
Scatter.prototype.implements(api_1.INDChart.prototype); | ||
Scatter.prototype.publish("paletteID", "default", "set", "Palette ID", Scatter.prototype._palette.switch(), { tags: ["Basic", "Shared"] }); | ||
Scatter.prototype.publish("scatterType", "scatter", "set", "Bullet Type", ["scatter", "bubble"], { tags: ["Basic"] }); | ||
}); | ||
//# sourceMappingURL=Scatter.js.map |
@@ -1,47 +0,57 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var Axis_1 = require("./Axis"); | ||
var SerialAxis = (function (_super) { | ||
tslib_1.__extends(SerialAxis, _super); | ||
function SerialAxis() { | ||
var _this = _super.call(this) || this; | ||
_this._parser = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
return _this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
return SerialAxis; | ||
}(Axis_1.Axis)); | ||
exports.SerialAxis = SerialAxis; | ||
SerialAxis.prototype._class += " amchart_SerialAxis"; | ||
SerialAxis.prototype.publish("axisFontSize", null, "number", "X/Y Axis Text Font Size", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisBaselineColor", "#000000", "string", "X Axis Baseline Color", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisFontColor", "#000000", "string", "Horizontal Axis Text Style (Color)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitle", "", "string", "X-Axis Title", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitleFontSize", null, "number", "Vertical Axis Title Text Style (Font Size)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitleFontColor", "#000000", "string", "Axis Title Text Style (Color)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisLabelRotation", 0, "number", "Axis Label Rotation", null, { min: 0, max: 90, step: 0.1, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
SerialAxis.prototype.publish("axisLineWidth", 1, "number", "Axis Line Width", null, { tags: ["Intermediate", "Shared"] }); | ||
SerialAxis.prototype.publish("axisAlpha", 1, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisAutoGridCount", true, "boolean", "Specifies Whether Number of GridCount Is Specified Automatically, According To The Axis Size", null, { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisGridPosition", "start", "set", "Specifies If A Grid Line Is Placed On The Center of A Cell or On The Beginning of A Cell", ["start", "middle"], { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisBoldPeriodBeginning", true, "boolean", "When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisDashLength", 0, "number", "Length of a dash. 0 means line is not dashed.", null, { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisFillAlpha", 0, "number", "Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisFillColor", null, "string", "Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisGridAlpha", 0.0, "number", "Grid alpha.", null, { tags: ["Intermediate"] }); | ||
// SerialAxis.prototype.publish("axisMinimum", null, "number", "",null,{tags:["Intermediate"]}); | ||
SerialAxis.prototype.publish("startOnAxis", true, "boolean", "Draw Chart Starting On Axis.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisTypeTimePattern", "%Y-%m-%d", "string", "Time Series Pattern"); | ||
SerialAxis.prototype.publish("axisType", "ordinal", "set", "X-Axis Type", ["ordinal", "linear", "time", "pow", "log", "none"]); | ||
SerialAxis.prototype.publish("axisTickFormat", "", "string", "Y-Axis Tick Format"); | ||
SerialAxis.prototype.publish("position", null, "set", "Position of Axis", ["top", "bottom", "left", "right"]); | ||
var axisTypeTimePattern = SerialAxis.prototype.axisTypeTimePattern; | ||
SerialAxis.prototype.axisTypeTimePattern = function (_) { | ||
var retVal = axisTypeTimePattern.apply(this, arguments); | ||
if (arguments.length) { | ||
this._parser = d3_time_format_1.timeParse(_); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "d3-time-format", "./Axis"], factory); | ||
} | ||
return retVal; | ||
}; | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var d3_time_format_1 = require("d3-time-format"); | ||
var Axis_1 = require("./Axis"); | ||
var SerialAxis = (function (_super) { | ||
tslib_1.__extends(SerialAxis, _super); | ||
function SerialAxis() { | ||
var _this = _super.call(this) || this; | ||
_this._parser = d3_time_format_1.timeParse("%Y-%m-%d"); | ||
return _this; | ||
} | ||
return SerialAxis; | ||
}(Axis_1.Axis)); | ||
exports.SerialAxis = SerialAxis; | ||
SerialAxis.prototype._class += " amchart_SerialAxis"; | ||
SerialAxis.prototype.publish("axisFontSize", null, "number", "X/Y Axis Text Font Size", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisBaselineColor", "#000000", "string", "X Axis Baseline Color", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisFontColor", "#000000", "string", "Horizontal Axis Text Style (Color)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitle", "", "string", "X-Axis Title", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitleFontSize", null, "number", "Vertical Axis Title Text Style (Font Size)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisTitleFontColor", "#000000", "string", "Axis Title Text Style (Color)", null, { tags: ["Basic", "Shared"] }); | ||
SerialAxis.prototype.publish("axisLabelRotation", 0, "number", "Axis Label Rotation", null, { min: 0, max: 90, step: 0.1, inputType: "range", tags: ["Intermediate", "Shared"] }); | ||
SerialAxis.prototype.publish("axisLineWidth", 1, "number", "Axis Line Width", null, { tags: ["Intermediate", "Shared"] }); | ||
SerialAxis.prototype.publish("axisAlpha", 1, "number", "Axis Alpha", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisAutoGridCount", true, "boolean", "Specifies Whether Number of GridCount Is Specified Automatically, According To The Axis Size", null, { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisGridPosition", "start", "set", "Specifies If A Grid Line Is Placed On The Center of A Cell or On The Beginning of A Cell", ["start", "middle"], { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisBoldPeriodBeginning", true, "boolean", "When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisDashLength", 0, "number", "Length of a dash. 0 means line is not dashed.", null, { tags: ["Advanced"] }); | ||
SerialAxis.prototype.publish("axisFillAlpha", 0, "number", "Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisFillColor", null, "string", "Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisGridAlpha", 0.0, "number", "Grid alpha.", null, { tags: ["Intermediate"] }); | ||
// SerialAxis.prototype.publish("axisMinimum", null, "number", "",null,{tags:["Intermediate"]}); | ||
SerialAxis.prototype.publish("startOnAxis", true, "boolean", "Draw Chart Starting On Axis.", null, { tags: ["Intermediate"] }); | ||
SerialAxis.prototype.publish("axisTypeTimePattern", "%Y-%m-%d", "string", "Time Series Pattern"); | ||
SerialAxis.prototype.publish("axisType", "ordinal", "set", "X-Axis Type", ["ordinal", "linear", "time", "pow", "log", "none"]); | ||
SerialAxis.prototype.publish("axisTickFormat", "", "string", "Y-Axis Tick Format"); | ||
SerialAxis.prototype.publish("position", null, "set", "Position of Axis", ["top", "bottom", "left", "right"]); | ||
var axisTypeTimePattern = SerialAxis.prototype.axisTypeTimePattern; | ||
SerialAxis.prototype.axisTypeTimePattern = function (_) { | ||
var retVal = axisTypeTimePattern.apply(this, arguments); | ||
if (arguments.length) { | ||
this._parser = d3_time_format_1.timeParse(_); | ||
} | ||
return retVal; | ||
}; | ||
}); | ||
//# sourceMappingURL=SerialAxis.js.map |
@@ -1,19 +0,29 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
require("amcharts3/amcharts/xy"); | ||
var SerialAxis_1 = require("./SerialAxis"); | ||
var XYAxis = (function (_super) { | ||
tslib_1.__extends(XYAxis, _super); | ||
function XYAxis() { | ||
return _super.call(this) || this; | ||
(function (factory) { | ||
if (typeof module === "object" && typeof module.exports === "object") { | ||
var v = factory(require, exports); | ||
if (v !== undefined) module.exports = v; | ||
} | ||
return XYAxis; | ||
}(SerialAxis_1.SerialAxis)); | ||
exports.XYAxis = XYAxis; | ||
XYAxis.prototype._class += " amchart_XYAxis"; | ||
XYAxis.prototype.publish("axisAutoGridCount", true, "boolean", "Specifies whether number of gridCount is specified automatically, acoarding to the axis size", null, { override: true, tags: ["Advanced"] }); | ||
XYAxis.prototype.publish("axisGridPosition", "middle", "set", "Specifies if a grid line is placed on the center of a cell or on the beginning of a cell", ["start", "middle"], { override: true, tags: ["Advanced"] }); | ||
XYAxis.prototype.publish("axisTickFormat", "", "string", "Y-Axis Tick Format", null, { optional: true, override: true }); | ||
XYAxis.prototype.publish("axisGridAlpha", 0.2, "number", "Grid alpha.", null, { override: true, tags: ["Intermediate"] }); | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "tslib", "amcharts3/amcharts/xy", "./SerialAxis"], factory); | ||
} | ||
})(function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
require("amcharts3/amcharts/xy"); | ||
var SerialAxis_1 = require("./SerialAxis"); | ||
var XYAxis = (function (_super) { | ||
tslib_1.__extends(XYAxis, _super); | ||
function XYAxis() { | ||
return _super.call(this) || this; | ||
} | ||
return XYAxis; | ||
}(SerialAxis_1.SerialAxis)); | ||
exports.XYAxis = XYAxis; | ||
XYAxis.prototype._class += " amchart_XYAxis"; | ||
XYAxis.prototype.publish("axisAutoGridCount", true, "boolean", "Specifies whether number of gridCount is specified automatically, acoarding to the axis size", null, { override: true, tags: ["Advanced"] }); | ||
XYAxis.prototype.publish("axisGridPosition", "middle", "set", "Specifies if a grid line is placed on the center of a cell or on the beginning of a cell", ["start", "middle"], { override: true, tags: ["Advanced"] }); | ||
XYAxis.prototype.publish("axisTickFormat", "", "string", "Y-Axis Tick Format", null, { optional: true, override: true }); | ||
XYAxis.prototype.publish("axisGridAlpha", 0.2, "number", "Grid alpha.", null, { override: true, tags: ["Intermediate"] }); | ||
}); | ||
//# sourceMappingURL=XYAxis.js.map |
{ | ||
"name": "@hpcc-js/amchart", | ||
"version": "0.0.1", | ||
"version": "0.0.5", | ||
"description": "hpcc-js - Viz AM Charts", | ||
@@ -20,4 +20,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@hpcc-js/api": "^0.0.1", | ||
"@hpcc-js/common": "^0.0.1", | ||
"@hpcc-js/api": "^0.0.5", | ||
"@hpcc-js/common": "^0.0.5", | ||
"amcharts3": "amcharts/amcharts3#3.18.0", | ||
"d3-array": "^1.2.0", | ||
@@ -27,3 +28,2 @@ "d3-format": "^1.2.0", | ||
"d3-selection": "^1.1.0", | ||
"amcharts3": "amcharts/amcharts3#3.18.0", | ||
"tslib": "^1.7.1" | ||
@@ -48,2 +48,2 @@ }, | ||
"homepage": "https://github.com/hpcc-systems/Visualization" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198301
4470
+ Added@hpcc-js/api@0.0.5(transitive)
+ Added@hpcc-js/common@0.0.5(transitive)
- Removed@hpcc-js/api@0.0.1(transitive)
- Removed@hpcc-js/common@0.0.1(transitive)
Updated@hpcc-js/api@^0.0.5
Updated@hpcc-js/common@^0.0.5