This paper shares the development of large screen visualization from the perspective of technology and tools ！
It mainly evaluates the visual large screen of report tool development ！
In the conventional way of data visualization, we can choose to read the database directly , Through drawing software / Library to draw , Finally, it forms a self built front-end display effect , For example, use Apache ECharts (incubating) Tools such as .
in addition to , In pursuit of efficiency, we can also choose mature report suite , Such packages often have a series of chart templates + Support push and drop and visual configuration page , It is convenient for us to quickly build a large visual screen . In fact, the mechanism of most packages is not very different , In order to reduce the content of the article , This article talks directly about one kind of suite ,
Of course, report suite can be divided into three categories ：
- Desktop applications , It's a desktop program , Programs often connect directly to cloud databases , Need database open public network ip. Some will be provided by the server crud api To reduce the risk of data leakage
- web End to end direct connection to database / Self built back-end products , This product is less , After all, it has been done web It's better to have a server , Otherwise, the database should be open ip
- B-S product , The server provides the connection with multi-source database 、 Data Extraction 、 Front end page generation , The front end is responsible for displaying 、 User interaction and dynamic refresh and so on
This article selects a third type of kit as the explanation -- The sails are soft FineReport, Why you chose this product ：
1、 Domestic software , Chinese document 、 Chinese configuration interface , It is highly user-friendly to domestic users
2、 The most advanced reporting tool in China , The development of large screen is mature
（ notes ： I try to describe from the perspective of visual reporting tools , Not for a specific product , Just for the sake of image and verifiable, will give FineReport In the following aspects of practice / programme , Without any additional comments ）
Since it's a suite, it should have a lot of complete and mature functions , Let's talk about it in these dimensions ：
- Environment and infrastructure ： Design platform , Installation environment , Fault transmission and tracing , Data security , Collaborative development , Functional scalability
- Visual effects and user interaction ： Layout , Color matching , Interaction , Reusable components , Component customization
First of all, let's talk about the design platform , There are generally two types of ：
- Traditional desktop application designer , The former is often directly installed, opened and used , about B/S Class products , Usually, the designer installation package will bring a service environment that can be used for debugging automatically after it is started
- be based on Web The designer of , Some of these designers support the design and provision of presentation services at the same time , That is, after a build, according to the login account role Into different environments , Some are completely separate sets of environments .
FineReport Belong to the former , For different systems, the installation package is easy to install , No need for complex configuration .
about B/S product , It's similar to building the back end , It's just that there's no need for complicated configuration , You can start the service by installing it directly according to the tutorial .
For the following functional expansibility , This step may be affected , If the product has functional scalability , Then the additional extended functions need to be deployed separately on the service and configured with relevant connections , If it is a plug-in based extension, you need to install the corresponding plug-in on the server side . In this section, it is recommended to build a complete environment building document , If the product can be installed by script , It is recommended to script the deployment process directly .
FineReport Environment installation is also the installation package , It has a plug-in platform , If there is a supplementary plug-in, you need to pass web Add the corresponding plug-in after login .
Enterprise data application stage , After data visualization, a large visualization screen is gradually produced . Visual large screen often single page information content is extremely rich 、 Across a wide range of business units 、 The dimensions of data analysis are comprehensive . So from a technical point of view , We need to make sure that a single fault doesn't spread to other information on a large scale , such as ：
- Whether the server side will be affected if the designer fails ？ Especially through role Distinguishing the environment web Designer .
- Whether the calculation error of individual indicators will lead to other indicators cannot be displayed on the same page ？
- Whether the slow calculation of individual indicators affects other indicators on the same page cannot be refreshed ？
What's extra to do with the fault is real-time processing ：
- Whether the key indicator calculation error should also be alerted ？ Because the running status of the large screen may also be an indicator
- When the index calculation is wrong, it shows 0 Or is it a real error message ？ Especially when the indicator has its unique existence significance , It is not recommended to use the same type of data as display at will , Avoid false statistics
- Although we guarantee the controllability of fault spread , But we also want to be able to trace back to the cause of the problem , This requires determining whether the relevant products have sufficient logs , In particular, the need lies in the interactive execution statement and execution response of the database .
Continue to say FineReport The situation of ：
- The calculation error of a single indicator will not affect the display of other indicators .
- The slow calculation speed of single index will not affect the overall opening speed , The calculated index value will be updated gradually , However, if the result is not calculated in the initial open process, there is a certain probability that the page layout is incorrect , This problem will be calculated step by step and dynamically adjust the layout , The end result is correct .
- There is a complete execution log in the design and debugging stage , Query executable sql Instruction trace calculation error problem , But for complex multi-level nesting / Page linkage and other behavior tracing is relatively complex, so we can consider developing log processing tools
- Production environment （ Server Edition ） The post deployment logs were not investigated
ideally , Our database should not use the public network IP, This is for the three types mentioned above ：
- Desktop applications ： Such programs often also support not directly connecting to the database , Data can be obtained through a self built back end or a back end of a suite .
- web Direct connect products ： Such products are only available based on Web Of UI Quickly build , It's like a background frame and so on , The specific data reading mode can be selected API or Direct connection database , Need to maintain data security on your own .
- B-S product ： This type of product provides complete front and rear end , The back end is responsible for the connection to the multi-source database , The front end is only responsible for receiving data 、 Passing instructions , Relatively can better protect the database security , Just put the server and database on the same cloud provider , Avoid opening the public network IP that will do . But the same risk is passed on to the back end of this type of product , Whether it is the back-end service or the product is based on Web The background of .
FineReport As B/S product , There is a complete server , In data aspect, the interaction between the front end and the back end is usually in the form of POST request .
Check it out ： Request parameters are controls id、 Control content 、 Behavior, etc , It won't involve the execution of sql. The returned result is the control information and data in the control . I'm not sure if there is any omission , Plus the use of SSL Security can be further improved .
Reporting is not a simple thing , Whether it is the means of data warehouse or the means of Data Center , From a business perspective , We all broke down departmental barriers first , Then let the data of each department collide with each other , Dig out more surplus value , This leads to the complexity of our reporting business and the workload of development , We have to do collaborative development , Especially the big screen .
A large visual screen may have dozens of modules , Each module has three or five or more analysis indicators , A page can easily appear more than 100 indicators , Therefore, it is very important to make the development process collaborative .
First of all, for collaboration, we need to consider the following questions ：
- How to connect the collaborative process database ： Because the database is on the cloud , For the sake of security, it will not open the external interface , Three ways are recommended at this time ：① Use QA Environmental Science , If QA The environment has accumulated enough false data and is not sensitive to data structure security , Consider this option , But it's not recommended .② Use VPN, So we can go through... Locally VPN Connect to the database .③ Use cloud server , Through the cloud development to achieve access to the database in the intranet .
- Single page division development method ： A page has more than 100 indicators , According to the business content, arrange tasks in groups , But at the same time, consider how the tool's log files can automatically merge, If you can't automatically merge How to do it manually merge,merge Whether the logic and layout information can be preserved normally ……
- Whether repetitive styles are easy to reuse ： When style repetition is just logic and title / When labels differ , Whether it can be reused , Whether there is the concept of template , After reuse, whether it can guarantee that only the logic changes, and the others have complete consistency to ensure the style unification
FineReport Support by changing the working directory to the remote working directory , Go straight to collaborative development , In this way, the storage location of the design file is put at the remote end , The real operation execution is still local , Similar to a design file version Manager .
Does the product offer modularity or Plug in platform , To support third-party plug-ins by exposing the interfaces of process critical nodes or other means 、 Access to custom components , To achieve “ Infinite possibilities ” The future of .
Plug ins include, but are not limited to ：
- More map sheet templates
- User interaction process more animation effect
- Fancy tip box
- Design stage layout tools
- Runtime log processing tool
- The overall color scheme （ The skin ? The theme ?）
- Custom calculation template / The formula 、 Domain professional formula set
- Authentication plug-in
- Database driven
FineReport There are plug-in platforms , It contains multiple categories , There are official plug-ins and third-party plug-ins , And plug-in development API file
- Is there an overall color scheme ？ Facilitate rapid prototyping without pursuing high customization , For example, night mode ……
- Whether the standard layout can be carried out in the design stage ： level 、 vertical 、 grid 、 flow 、 Fill in the form （label+editbox）……
- Layers 、 transparency 、 visibility 、 The box model
- Whether special effects can control the flow of events
- Responsive layout
FineReport The absolute layout can be selected on the layout （ Everything is dragged by hand ）, Or choose an adaptive layout , It can be configured with two-way single （ level 、 vertical 、 grid ） At the same time, the inner margin and the margin between components can be configured .
- The graph automatically refreshes
- Graph linkage
- Parameter configuration linkage
- Animation effect
- Prompt window
Reusability also affects the efficiency of collaborative development directly or indirectly 、 Finally, it shows the consistency of the effect and so on .
FineReport A web plug-in is provided , Other components can be referenced by inserting web controls , Combining multiple display blocks in a nested manner .
It also provides template plug-ins , By packaging selected components into a template , At the same time, the layout relationship between components is packaged 、 Data manipulation logic , Realized the logic 、 Relationship and the overall migration and reuse of controls , But it can only remember the layout relationship , Can't remember the final size of the layout , After repeated reuse, the overall size needs to be adjusted .
This type of tool improves development efficiency by persisting a variety of common functions , But it's hard to avoid meeting special needs , At this point, a high degree of freedom is needed , Such as providing plug-in platforms 、 Component design 、API Interface 、 A programmable ……
FineReport Provide for the right to JS Support for , You can trigger the corresponding... In many spaces when you click JS Script , It's up to us to develop our own .
At the same time, there are plug-in platforms , You can persist reusable functions through plug-ins , There are template plug-ins , Can be repeated components / Component sets are persisted .
本文为[The sail is soft]所创，转载请带上原文链接，感谢