@antv/t8
Version:
T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative T8 markdown syntax that can be used to describe the content of data interpretation reports.
26 lines (23 loc) • 977 B
JavaScript
import { renderRankChart } from '../rank/index.js';
import '../utils/selection.js';
import { arrow } from '../utils/paths.js';
import { ARROW_FILL_COLOR } from '../utils/const.js';
var renderDifferenceChart = function (container, config, paragraphType, themeSeedToken) {
var _a = config.data, data = _a === void 0 ? [] : _a;
if (!data.length)
return;
renderRankChart(container, {
data: data,
drawSvgCallback: function (svg, xScale, yScale) {
// draw arrow on rank chart
var arrowPath = arrow(xScale, yScale);
svg
.append('path')
.attr('d', arrowPath({ index: 0 + 0.5, value: data[0] }, { index: data.length - 1 + 0.5, value: data[data.length - 1] }))
.attr('stroke', ARROW_FILL_COLOR)
.attr('fill', ARROW_FILL_COLOR);
},
}, paragraphType, themeSeedToken);
};
export { renderDifferenceChart };
//# sourceMappingURL=index.js.map