UNPKG

@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

112 lines (104 loc) 2.52 kB
import { BASIC_HEAT_MAP_COLOR_THEMES } from "../constants"; import { arrayData, color } from "./common"; export const 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 }; }; export const basicHeatMapRegion = context => { const {spec: spec} = context; return spec.region = [ { id: "region0", width: 200, height: 200, padding: { top: 40 } } ], { spec: spec }; }; export const basicHeatMapColor = context => { const {spec: spec, cell: cell} = context; return spec.color = { type: "linear", domain: [ { dataId: "data", fields: [ cell.size ] } ], range: BASIC_HEAT_MAP_COLOR_THEMES }, { spec: spec }; }; export 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 }; }; export const basicHeatMapLegend = context => { const {spec: spec} = context; return spec.legends = { visible: !0, orient: "right", position: "start", type: "color", field: "value" }, { spec: spec }; }; export const pipelineBasicHeatMap = [ arrayData, color, basicHeatMapSeries, basicHeatMapRegion, basicHeatMapColor, basicHeatMapAxes, basicHeatMapLegend ]; //# sourceMappingURL=heatmap.js.map