


This example shows how to build the combined effect of two nodes, a connection, and a Group. It can be easily understood that building a topological interface is basically to operate DataModel dataModel. The following is the model code part that builds the effect of the above interface:
// init data modelhello = new ht.Node(); hello.setPosition(60, 140); hello.setName('Hello'); hello.setStyle('note', 'I love HT'); hello.setStyle('note.background', '#FFA000'); dataModel.add(hello); world = new ht.Node(); world.setPosition(260, 80); world.setName('World'); world.setStyle('note', 'HT for your imagination'); world.setStyle('note.expanded', false); world.setStyle('border.color', 'red'); dataModel.add(world); edge = new ht.Edge(hello, world); edge.setName('Hello World\nwww.hightopo.com'); edge.setStyle('label.color', 'white'); edge.setStyle('label.background', '#3498DB'); dataModel.add(edge); group = new ht.Group(); group.setName('HT for Web ' + ht.Default.getVersion()); group.addChild(hello); group.addChild(world); group.addChild(edge); dataModel.add(group);
Of course, the real system will not look like the above code. The content is hard-coded. Generally, users query the background data, and then dynamically create topological nodes, connections, groups, subnets and other graphic elements based on the background data, and fill in the graphic element names, connection colors, alarm contents, etc. Attribute information, and because HT technology is based on HTML5, most industrial control Web SCADA customers have adopted the real-time communication method of WebSocket. For information on the use of WebSocket, please refer to this article: 3D topology automatic layout of Node. js Article
Building a model is as simple as above. The remaining work is to set the corresponding graphic element attributes to achieve information display and beautiful effects. Regarding the customization of graphic elements and even the overall HT graphic component style, you can Referring to the "HT for Web Style Manual", here I give a simple little detail, but some people noticed that the code for setting the label above is a bit special:
edge.setName('Hello World\nwww.hightopo.com');
Here\n As the name suggests, it means line break, of course except for line break In addition, you can also have vertical layout and other fancy display forms. You can refer to the introduction of the article "Smart Application of Text on Network Topology Map":
var list = [], node;for (var i = 0; i < 4; i++) { node = new ht.Node(); node.setImage('station'); node.p(100 + i * 100, 100); dm.add(node); list.push(node); } node = list[0]; node.s({ 'label': '厦门', 'label.font': '22px arial, sans-serif', 'label2': 'Xiamen', 'label2.position': 31, 'label2.offset.y': 23}); node = list[1]; node.s({ 'label': '图\n扑', 'label.position': 14, 'label.font': '22px arial, sans-serif', 'label2': 'Hightopo', 'label2.position': 14, 'label2.offset.x': -7, 'label2.rotation': -Math.PI / 2}); node = list[2]; node.s({ 'label': '上\n海', 'label.position': 20, 'label.font': '22px arial, sans-serif', 'label2': 'Shanghai', 'label2.position': 20, 'label2.offset.x': 6, 'label2.rotation': -Math.PI / 2}); node = list[3]; node.s({ 'label': '北京', 'label.position': 3, 'label.font': '22px arial, sans-serif', 'label2': 'Beijing', 'label2.position': 3, 'label2.offset.y': -23});
Of course, it can also be achieved. To achieve the effect of dynamically rotating text, drag the red ball below to achieve the effect of dynamically rotating text:
From the above example, you can refer to just a text and set the color and background. , font, maximum length and other parameters. If you add the Position layout and 3D layout, you can almost write an independent article based on text. This is not enough here. If you are interested, you can play with various examples of the position manual:
After constructing the connection relationship of the primitives and setting the style attributes of the primitives, the next main issue is the placement of primitives. For the placement of primitives in the field of industrial control, it is generally It is done manually, so the Web SCADA industrial control field generally builds a set of HMI human-machine interface drawing tools for its own products:
For telecommunications network management topology applications, due to the network topology The amount of graph element data is often very huge. Although the HT topology graph component is very powerful and can carry several or even hundreds of thousands of network topologyvector graph elements without any pressure, how to realize such a large amount of data elements? The layout is a problem. If it is regular, it will be easier. You can write two for loops to realize the grid layout. This example is generally used in the energy industry control system. By using the vector format of HT, the fan can be dynamically controlled. Parameters such as rotation speed and color can visually express the operating status of the fan. This example is not specially optimized for mobile phones, but I specifically used iOS Safari to run it. I have to say that Safari 10 is still worthy of this example of HT. Apple is still working hard to improve HTML5 in its product line. The
#ECMAScript 2015standard, also known as ES6, is completely supported, bringing this major
JavaScriptevolution to Safari on macOS and iOS.
However, more telecom network management topology map applications will use the automatic layout function of HT. Making good use of the automatic layout function can greatly reduce the implementation workload of project launch, and telecom equipment often needs to automatically detect dynamic changes, which is almost impossible to complete manually. These things. If combined with the recent remarks of Huawei boss Ren Zhengfei, it can be imagined that Huawei's telecom network management topology in the future should make use of its unique industry network data and rely on artificial intelligence to provide automatic layout algorithm layout. Okay, let me digress and get back to the topic.
In fact, automatic layout cannot provide algorithms to place graphics elements in order to meet the needs of business display. These two articles analyze in detail how to customize the bus and any arbitrary Curve layout case:
The above is to create a network primitive, set the connection relationship between the primitives, configure the style attributes of the primitives, and layout the primitives to construct the topology diagram. With a few basic steps, you can actually develop a decent HTML5 network topology map application in minutes if you are familiar with HT. Users can serialize the entire topology map into a string of JSON format content, so that you can save it to the backend database or backend. Any server file is acceptable. HT is just a front-end graphical component and does not involve backend communication and storage. Anyway, the control is yours without any constraints. You can design the overall system architecture of your network topology as you like.
The above is the detailed content of Detailed explanation of rapid development of applications based on HTML5 network topology diagram (pictures and text). For more information, please follow other related articles on the PHP Chinese website!

H5 is HTML5, the fifth version of HTML. HTML5 improves the expressiveness and interactivity of web pages, introduces new features such as semantic tags, multimedia support, offline storage and Canvas drawing, and promotes the development of Web technology.

Accessibility and compliance with network standards are essential to the website. 1) Accessibility ensures that all users have equal access to the website, 2) Network standards follow to improve accessibility and consistency of the website, 3) Accessibility requires the use of semantic HTML, keyboard navigation, color contrast and alternative text, 4) Following these principles is not only a moral and legal requirement, but also amplifying user base.

The H5 tag in HTML is a fifth-level title that is used to tag smaller titles or sub-titles. 1) The H5 tag helps refine content hierarchy and improve readability and SEO. 2) Combined with CSS, you can customize the style to enhance the visual effect. 3) Use H5 tags reasonably to avoid abuse and ensure the logical content structure.

The methods of building a website in HTML5 include: 1. Use semantic tags to define the web page structure, such as, , etc.; 2. Embed multimedia content, use and tags; 3. Apply advanced functions such as form verification and local storage. Through these steps, you can create a modern web page with clear structure and rich features.

A reasonable H5 code structure allows the page to stand out among a lot of content. 1) Use semantic labels such as, etc. to organize content to make the structure clear. 2) Control the rendering effect of pages on different devices through CSS layout such as Flexbox or Grid. 3) Implement responsive design to ensure that the page adapts to different screen sizes.

The main differences between HTML5 (H5) and older versions of HTML include: 1) H5 introduces semantic tags, 2) supports multimedia content, and 3) provides offline storage functions. H5 enhances the functionality and expressiveness of web pages through new tags and APIs, such as and tags, improving user experience and SEO effects, but need to pay attention to compatibility issues.

The difference between H5 and HTML5 is: 1) HTML5 is a web page standard that defines structure and content; 2) H5 is a mobile web application based on HTML5, suitable for rapid development and marketing.

The core features of HTML5 include semantic tags, multimedia support, form enhancement, offline storage and local storage. 1. Semantic tags such as, improve code readability and SEO effect. 2. Multimedia support simplifies the process of embedding media content through and tags. 3. Form Enhancement introduces new input types and verification properties, simplifying form development. 4. Offline storage and local storage improve web page performance and user experience through ApplicationCache and localStorage.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
