g6自定义html,自定义树图

更新时间:2023-06-08 22:54:08 阅读: 评论:0

g6⾃定义html,⾃定义树图
源码复制成功复制失败全屏 复制 运⾏
⾃定义树图
var COLLAPSE_ICON = function COLLAPSE_ICON(x, y, r) {
return [['M', x, y], ['a', r, r, 0, 1, 0, r * 2, 0], ['a', r, r, 0, 1, 0, -r * 2, 0], ['M', x + 2, y], ['L', x + 2 * r - 2, y]];
婴儿手脚出汗};
var EXPAND_ICON = function EXPAND_ICON(x, y, r) {
return [['M', x, y], ['a', r, r, 0, 1, 0, r * 2, 0], ['a', r, r, 0, 1, 0, -r * 2, 0], ['M', x + 2, y], ['L', x + 2 * r - 2, y], ['M', x + r, y - r + 2], ['L', x + r, y + r - 2]];
};
drawShape: function drawShape(cfg, group) {
var rect = group.addShape('rect', {
attrs: {
fill: '#fff',
stroke: '#666'
}
});
var content = place(/(.{19})/g, '$1\n');
var text = group.addShape('text', {
attrs: {
text: content,
x: 0,
吓死人
y: 0,
textAlign: 'left',
textBaline: 'middle',
fill: '#666'
花和尚鲁智深}
});
var bbox = BBox();
var hasChildren = cfg.children && cfg.children.length > 0;
if (hasChildren) {
group.addShape('marker', {
x: bbox.maxX + 6,
y: bbox.minX + bbox.height / 2 - 6,
r: 6,
symbol: COLLAPSE_ICON,
stroke: '#666',
lineWidth: 2
},
className: 'collap-icon'
});
}
rect.attr({
x: bbox.minX - 4,
y: bbox.minY - 6,
width: bbox.width + (hasChildren ? 26 : 8),
height: bbox.height + 12
});
return rect;
}土豆片
褥疮用什么药膏最好
}, 'single-shape');
var graph = new G6.TreeGraph({
container: 'mountNode',
width: window.innerWidth,
height: window.innerHeight,
modes: {
default: [{
type: 'collap-expand',
onChange: function onChange(item, collapd) {
var data = ('model');
var icon = ('group').findByClassName('collap-icon'); if (collapd) {
icon.attr('symbol', EXPAND_ICON);
} el {
icon.attr('symbol', COLLAPSE_ICON);
}
}, 'drag-canvas', 'zoom-canvas'] },
defaultNode: {
shape: 'tree-node', anchorPoints: [[0, 0.5], [1, 0.5]] },
defaultEdge: {
shape: 'cubic-horizontal',
style: {
stroke: '#A3B1BF'
}
},
layout: {
type: 'compactBox',
direction: 'LR',
getId: function getId(d) {
return d.id;
},
getHeight: function getHeight() { return 16;
02j915},
getWidth: function getWidth() { return 16;
},
getVGap: function getVGap() { return 20;
},
getHGap: function getHGap() { return 80;
}
});
$.getJSON('/os/antvdemo/asts/data/modeling-methods.json', function(data) { averTree(data, function(item) {
item.id = item.name;
});
双语阅读graph.data(data);
素菜食谱家常菜
graph.fitView();
});

本文发布于:2023-06-08 22:54:08,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1027180.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:复制   定义   手脚   食谱   褥疮
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图