mirror of
https://gitee.com/antv/g6.git
synced 2024-12-16 02:21:25 +08:00
refactor: domId -> containerId
This commit is contained in:
parent
c9be11eb3d
commit
b45fd090dd
@ -92,7 +92,7 @@
|
||||
});
|
||||
const nodeSizeMapper = new Mapper('node', 'userview', 'size', [20, 50], {
|
||||
legendCfg: {
|
||||
domId: 'legend',
|
||||
comtainerId: 'legend',
|
||||
scale: 0.5
|
||||
}
|
||||
});
|
||||
@ -101,7 +101,7 @@
|
||||
});
|
||||
const nodeColorMapper = new Mapper('node', 'stayTime', 'color', ['#BAE7FF', '#1890FF', '#0050B3'], {
|
||||
legendCfg: {
|
||||
domId: 'legend',
|
||||
comtainerId: 'legend',
|
||||
scale: 0.5
|
||||
}
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ class Plugin {
|
||||
* @type {object}
|
||||
*/
|
||||
legendCfg: {
|
||||
domId: 'legend_container',
|
||||
comtainerId: 'legend_container',
|
||||
legendTitle: '',
|
||||
scale: 1
|
||||
},
|
||||
@ -177,19 +177,19 @@ class Plugin {
|
||||
const scaleType = this._getScaleType(data);
|
||||
const channel = this.channel;
|
||||
const graph = this.graph;
|
||||
let dom_id = this.legendCfg.domId;
|
||||
let comtainerId = this.legendCfg.comtainerId;
|
||||
|
||||
if (dom_id === undefined) {
|
||||
dom_id = 'legend_container';
|
||||
let legendContainer = document.getElementById(dom_id);
|
||||
legendContainer = Util.createDOM('<div id="' + dom_id + '"class="legend-container"></div>');
|
||||
if (comtainerId === undefined) {
|
||||
comtainerId = 'legend_container';
|
||||
let legendContainer = document.getElementById(comtainerId);
|
||||
legendContainer = Util.createDOM('<div id="' + comtainerId + '"class="legend-container"></div>');
|
||||
const container = graph.getGraphContainer();
|
||||
container.appendChild(legendContainer);
|
||||
}
|
||||
|
||||
const Constructor = graph.getConstructor('Canvas');
|
||||
const canvas = new Constructor({
|
||||
containerId: dom_id, // dom_id,
|
||||
containerId: comtainerId, // dom_id,
|
||||
width: 500,
|
||||
height: 500
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user