Enable view in Antvg2 when multiple views coexist.

To enable multiple views to coexist in AntVG2, you can follow these steps:

  1. generate a view
var view1 = antv.createView({
  container: 'container1',
  ...
});
var view2 = antv.createView({
  container: 'container2',
  ...
});

This creates two view instances, each placed in the elements container1 and container2 respectively.

  1. Translate
view1.render();
view2.render();

You can use the render method to render the corresponding data and configuration into the corresponding view.

  1. information
  2. data being viewed
// 设置数据
view1.data({
  nodes: [...],
  edges: [...]
});

// 获取数据
var data = view1.data();
  1. You can manipulate the view by using other methods in the view instance, such as adding elements, updating the view, and so on.

By following the above steps, you can enable multiple views to coexist in AntVG2. You can further customize and operate according to specific requirements.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds