feat: legend use containerDOM

This commit is contained in:
huangtong.ht 2018-10-11 10:00:12 +08:00
parent 5fe45ee554
commit ce239d1033
4 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@
<script>
var graph = null;
var clickOnNode = null;
const legend = document.getElementById('legend');
// $.getJSON('./assets/data/view-test.json', data => {
$.getJSON('./assets/data/view-test-antv.json', data => {
//the plugins
@ -34,7 +34,7 @@
});
let nodeSizeMapper = new Mapper('node', 'weight', 'size', [15, 50], {
legendCfg: {
containerId: 'legend',
containerDOM: legend,
height: 100,
title: {
text: 'UV',

View File

@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "2.1.3",
"version": "2.1.4-beta.1",
"description": "graph visualization frame work",
"main": "build/g6.js",
"homepage": "https://github.com/antvis/g6",

View File

@ -172,7 +172,7 @@ class Plugin {
const graph = this.graph;
const containerId = this.legendCfg.containerId;
let legendContainer = this.legendCfg.container;
let legendContainer = this.legendCfg.containerDOM;
if (legendContainer === undefined) {
if (containerId === undefined) {
legendContainer = Util.createDOM('<div class="legend-container"></div>');

View File

@ -1 +1 @@
module.exports = '2.1.3';
module.exports = '2.1.4-beta.1';