UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

49 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GaugeRange = exports.Gauge = void 0; class Gauge { constructor(json) { this.fromJson(json); } /** * Load Gauge object represented by the GaugeSDT.ToJson() */ fromJson(json) { var _a; let sdt; try { sdt = JSON.parse(json); } catch (e) { sdt = {}; } switch ((_a = sdt.Type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) { case "circular": case "circle": this.type = "circle"; break; case "line": default: this.type = "line"; break; } this.value = sdt.Value || 0; this.minValue = sdt.MinValue || 0; this.maxValue = sdt.MaxValue || 0; this.thickness = sdt.Thickness || 10; this.showValue = sdt.ShowValue || false; this.showMinMax = sdt.ShowMinMax || false; this.ranges = sdt.Ranges ? sdt.Ranges.map(range => ({ name: range.Name, amount: range.Length, color: range.Color })) : []; } } exports.Gauge = Gauge; class GaugeRange { } exports.GaugeRange = GaugeRange; //# sourceMappingURL=gauge.js.map