@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
256 lines (255 loc) • 7.63 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.singleColorModeOptions = exports.formItemLayout = exports.enableOptions = exports.switchOptions = exports.labelValueOptions = exports.labelLayoutTypeOptions = exports.sortOrders = exports.legendPositions = exports.legendValueDisplayOptions = exports.yEmptyValueModes = exports.lineYEmptyValueModes = exports.axisIntervalTypes = exports.yScales = exports.xValueLabelShowModes = exports.xLabelShowModes = exports.xLabelRotations = void 0;
var react_1 = __importDefault(require("react"));
var type_1 = require("../../constants/language/base/type");
var chart_style_1 = require("../../constants/chart-style");
var map_style_1 = require("../../constants/map-style");
var language_1 = require("../../services/language");
var metric_panel_style_1 = require("../../constants/metric-panel-style");
var type_2 = require("../../constants/language/other/type");
var styles = __importStar(require("./style.mless"));
exports.xLabelRotations = [
{
value: "90" /* RotateM90 */,
item: react_1.default.createElement("span", { className: styles.rotateM90 }, "abc")
},
{
value: "45" /* RotateM45 */,
item: react_1.default.createElement("span", { className: styles.rotateM45 }, "abc")
},
{
value: "0" /* Zero */,
item: react_1.default.createElement("span", { className: styles.rotate0 }, "abc")
},
{
value: "-45" /* Rotate45 */,
item: react_1.default.createElement("span", { className: styles.rotate45 }, "abc")
},
{
value: "-90" /* Rotate90 */,
item: react_1.default.createElement("span", { className: styles.rotate90 }, "abc")
}
];
exports.xLabelShowModes = [
{
value: "showauto" /* ShowAuto */,
item: type_1.BaseLocale.x.auto
},
{
value: "showall" /* ShowAll */,
item: type_1.BaseLocale.x.all
},
{
value: "hide" /* Hide */,
item: type_1.BaseLocale.x.hide
}
];
exports.xValueLabelShowModes = [
{
value: "showauto" /* ShowAuto */,
item: type_1.BaseLocale.x.show
},
{
value: "hide" /* Hide */,
item: type_1.BaseLocale.x.hide
}
];
exports.yScales = [
{
value: "value" /* Value */,
item: type_1.BaseLocale.y.scale.linear
},
{
value: "log" /* Log */,
item: type_1.BaseLocale.y.scale.log
},
{
value: "time" /* Time */,
item: type_1.BaseLocale.y.scale.time
},
{
value: "category" /* Category */,
item: type_1.BaseLocale.y.scale.category
}
];
exports.axisIntervalTypes = [
{
value: "auto" /* Auto */,
item: type_1.BaseLocale.axis.interval.type.auto
},
{
value: "split" /* Split */,
item: type_1.BaseLocale.axis.interval.type.split
},
{
value: "fixed" /* Fixed */,
item: type_1.BaseLocale.axis.interval.type.fixed
}
];
exports.lineYEmptyValueModes = [
{
value: "0" /* Zero */,
item: type_1.BaseLocale.y.empty.zero
},
{
value: "gap" /* Gap */,
item: type_1.BaseLocale.y.empty.gap
},
{
value: "line" /* Line */,
item: type_1.BaseLocale.y.empty.line
}
];
exports.yEmptyValueModes = [
{
value: "gap" /* Gap */,
item: type_1.BaseLocale.y.empty.gap
},
{
value: "line" /* Line */,
item: type_1.BaseLocale.y.empty.line
}
];
exports.legendValueDisplayOptions = [
{
value: "current" /* Current */,
label: chart_style_1.LegendValueDisplayLabel["current" /* Current */]
},
{
value: "avg" /* Avg */,
label: chart_style_1.LegendValueDisplayLabel["avg" /* Avg */]
},
{
value: "min" /* Min */,
label: chart_style_1.LegendValueDisplayLabel["min" /* Min */]
},
{
value: "max" /* Max */,
label: chart_style_1.LegendValueDisplayLabel["max" /* Max */]
},
{
value: "total" /* Total */,
label: chart_style_1.LegendValueDisplayLabel["total" /* Total */]
},
{
value: "median" /* Median */,
label: chart_style_1.LegendValueDisplayLabel["median" /* Median */]
},
{
value: "mode" /* Mode */,
label: chart_style_1.LegendValueDisplayLabel["mode" /* Mode */]
}
];
exports.legendPositions = [
{
value: "top" /* Top */,
item: type_1.BaseLocale.legend.position.top
},
{
value: "bottom" /* Bottom */,
item: type_1.BaseLocale.legend.position.bottom
},
{
value: "left" /* Left */,
item: type_1.BaseLocale.legend.position.left
},
{
value: "right" /* Right */,
item: type_1.BaseLocale.legend.position.right
},
{
value: "none" /* None */,
item: type_1.BaseLocale.legend.position.none
}
];
exports.sortOrders = [
{ text: type_1.BaseLocale.legend.sort_order.ascend, value: 'ascend' },
{ text: type_1.BaseLocale.legend.sort_order.descend, value: 'descend' }
];
exports.labelLayoutTypeOptions = [
{
value: true,
item: type_1.BaseLocale.on
},
{
value: false,
item: type_1.BaseLocale.off
}
// todo://echarts版本 更新后改为下面配置,可以考虑保留隐藏
// {
// value: ELabelLayoutType.ADAPTIVE,
// item: BaseLocale.label.layout_type.adaptive
// },
// {
// value: ELabelLayoutType.ALL,
// item: BaseLocale.label.layout_type.all
// }
];
exports.labelValueOptions = [
{
value: map_style_1.ELabelValueType.FIELD,
text: language_1.formatString(type_1.BaseLocale.label.value_type.field)
},
{
value: map_style_1.ELabelValueType.VALUE,
text: language_1.formatString(type_1.BaseLocale.label.value_type.number)
}
];
exports.switchOptions = [
{
value: true,
item: type_1.BaseLocale.on
},
{
value: false,
item: type_1.BaseLocale.off
}
];
exports.enableOptions = [
{
value: false,
item: type_1.BaseLocale.disable
},
{
value: true,
item: type_1.BaseLocale.enable
}
];
exports.formItemLayout = {
labelCol: { span: 8 },
wrapperCol: { span: 16 }
};
// 指标图颜色模式
exports.singleColorModeOptions = [
{
value: metric_panel_style_1.EColorMode.NORMAL,
item: type_2.OtherLocale.status.color_value
},
{
value: metric_panel_style_1.EColorMode.INVERTED,
item: type_2.OtherLocale.status.color_value_bg
}
];