@visactor/vmind
Version:
<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu
122 lines (110 loc) • 3.02 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.pipelineBasicHeatMap = exports.basicHeatMapLegend = exports.basicHeatMapAxes = exports.basicHeatMapColor = exports.basicHeatMapRegion = exports.basicHeatMapSeries = void 0;
const constants_1 = require("../constants"), common_1 = require("./common"), basicHeatMapSeries = context => {
const {spec: spec, cell: cell} = context;
return spec.series = [ {
type: "heatmap",
regionId: "region0",
xField: cell.x,
yField: cell.y,
valueField: cell.size,
cell: {
style: {
fill: {
field: cell.size,
scale: "color"
}
}
}
} ], {
spec: spec
};
};
exports.basicHeatMapSeries = basicHeatMapSeries;
const basicHeatMapRegion = context => {
const {spec: spec} = context;
return spec.region = [ {
id: "region0",
width: 200,
height: 200,
padding: {
top: 40
}
} ], {
spec: spec
};
};
exports.basicHeatMapRegion = basicHeatMapRegion;
const basicHeatMapColor = context => {
const {spec: spec, cell: cell} = context;
return spec.color = {
type: "linear",
domain: [ {
dataId: "data",
fields: [ cell.size ]
} ],
range: constants_1.BASIC_HEAT_MAP_COLOR_THEMES
}, {
spec: spec
};
};
exports.basicHeatMapColor = basicHeatMapColor;
const basicHeatMapAxes = context => {
const {spec: spec} = context;
return spec.axes = [ {
orient: "bottom",
type: "band",
grid: {
visible: !1
},
domainLine: {
visible: !1
},
label: {
space: 10,
style: {
textAlign: "left",
textBaseline: "middle",
angle: 90,
fontSize: 8
}
},
bandPadding: 0,
height: layoutRect => layoutRect.height - 314
}, {
orient: "left",
type: "band",
grid: {
visible: !1
},
domainLine: {
visible: !1
},
label: {
space: 10,
style: {
fontSize: 8
}
},
bandPadding: 0
} ], {
spec: spec
};
};
exports.basicHeatMapAxes = basicHeatMapAxes;
const basicHeatMapLegend = context => {
const {spec: spec} = context;
return spec.legends = {
visible: !0,
orient: "right",
position: "start",
type: "color",
field: "value"
}, {
spec: spec
};
};
exports.basicHeatMapLegend = basicHeatMapLegend, exports.pipelineBasicHeatMap = [ common_1.arrayData, common_1.color, exports.basicHeatMapSeries, exports.basicHeatMapRegion, exports.basicHeatMapColor, exports.basicHeatMapAxes, exports.basicHeatMapLegend ];
//# sourceMappingURL=heatmap.js.map